summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2008-11-21 15:21:50 +0100
committerGuilhem Bichot <guilhem@mysql.com>2008-11-21 15:21:50 +0100
commit33b194c36ec28528fd349dd17412848de2f1171c (patch)
tree68cba4897925b9395dd0bfe53b5b95a777d78637
parent8d96bcda72df224f7a656cbcc1535a027bada75f (diff)
parent1d521f6c20881997c9162bd11cadcbc77d20520b (diff)
downloadmariadb-git-33b194c36ec28528fd349dd17412848de2f1171c.tar.gz
Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, or mysql-test/t/*myisam*.
However there were three new tests mysql-test/suite/parts/t/partition*myisam.test, of which I make here copies for Maria.
-rwxr-xr-xBUILD/SETUP.sh4
-rwxr-xr-xBUILD/compile-dist33
-rwxr-xr-x[-rw-r--r--]BUILD/compile-solaris-amd64-forte7
-rw-r--r--BUILD/compile-solaris-amd64-forte-debug4
-rwxr-xr-xBUILD/compile-solaris-sparc2
-rwxr-xr-xBUILD/compile-solaris-sparc-forte2
-rw-r--r--client/mysqldump.c9
-rw-r--r--configure.in105
-rw-r--r--extra/Makefile.am7
-rw-r--r--include/Makefile.am13
-rw-r--r--include/hash.h88
-rw-r--r--include/my_pthread.h3
-rw-r--r--include/thr_lock.h8
-rw-r--r--man/Makefile.am4
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test39
-rw-r--r--mysql-test/extra/binlog_tests/blackhole.test9
-rw-r--r--mysql-test/extra/binlog_tests/innodb_stat.test10
-rw-r--r--mysql-test/extra/rpl_tests/rpl_EE_err.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_blackhole.test32
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_basic.test181
-rw-r--r--mysql-test/include/index_merge1.inc15
-rw-r--r--mysql-test/include/mix1.inc1
-rw-r--r--mysql-test/include/ndb_backup_print.inc3
-rw-r--r--mysql-test/lib/mtr_cases.pl93
-rw-r--r--mysql-test/lib/mtr_report.pl2
-rwxr-xr-xmysql-test/mysql-test-run.pl26
-rw-r--r--mysql-test/r/alter_table.result30
-rw-r--r--mysql-test/r/auto_increment.result8
-rw-r--r--mysql-test/r/binlog_format_basic.result3
-rw-r--r--mysql-test/r/compare.result5
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result6
-rw-r--r--mysql-test/r/ctype_ucs.result11
-rw-r--r--mysql-test/r/distinct.result59
-rw-r--r--mysql-test/r/events_2.result77
-rw-r--r--mysql-test/r/events_bugs.result62
-rw-r--r--mysql-test/r/explain.result75
-rw-r--r--mysql-test/r/federated.result52
-rw-r--r--mysql-test/r/federated_bug_25714.result7
-rw-r--r--mysql-test/r/func_group.result37
-rw-r--r--mysql-test/r/group_by.result30
-rw-r--r--mysql-test/r/index_merge_myisam.result10
-rw-r--r--mysql-test/r/information_schema.result12
-rw-r--r--mysql-test/r/information_schema_db.result21
-rw-r--r--mysql-test/r/information_schema_part.result9
-rw-r--r--mysql-test/r/innodb-semi-consistent.result2
-rw-r--r--mysql-test/r/innodb.result17
-rw-r--r--mysql-test/r/innodb_data_home_dir_basic.result10
-rw-r--r--mysql-test/r/innodb_flush_method_basic.result10
-rw-r--r--mysql-test/r/innodb_mysql.result10
-rw-r--r--mysql-test/r/join.result12
-rw-r--r--mysql-test/r/limit.result3
-rw-r--r--mysql-test/r/loaddata.result121
-rw-r--r--mysql-test/r/lock_multi.result34
-rw-r--r--mysql-test/r/log_basic.result4
-rw-r--r--mysql-test/r/log_bin_trust_routine_creators_basic.result26
-rw-r--r--mysql-test/r/log_state.result28
-rw-r--r--mysql-test/r/log_tables.result59
-rw-r--r--mysql-test/r/merge.result21
-rw-r--r--mysql-test/r/metadata.result17
-rw-r--r--mysql-test/r/mysqldump-max.result13
-rw-r--r--mysql-test/r/mysqldump.result30
-rw-r--r--mysql-test/r/order_by.result16
-rw-r--r--mysql-test/r/partition.result319
-rw-r--r--mysql-test/r/partition_archive.result19
-rw-r--r--mysql-test/r/partition_datatype.result6
-rw-r--r--mysql-test/r/partition_innodb.result78
-rw-r--r--mysql-test/r/partition_innodb_stmt.result48
-rw-r--r--mysql-test/r/partition_mgm.result47
-rw-r--r--mysql-test/r/partition_mgm_err.result12
-rw-r--r--mysql-test/r/partition_not_windows.result8
-rw-r--r--mysql-test/r/partition_range.result66
-rw-r--r--mysql-test/r/partition_symlink.result8
-rw-r--r--mysql-test/r/partition_windows.result12
-rw-r--r--mysql-test/r/ps_11bugs.result28
-rw-r--r--mysql-test/r/show_check.result8
-rw-r--r--mysql-test/r/slow_launch_time_func.result40
-rw-r--r--mysql-test/r/sp-error.result7
-rw-r--r--mysql-test/r/sp.result41
-rw-r--r--mysql-test/r/ssl_capath_basic.result10
-rw-r--r--mysql-test/r/ssl_cipher_basic.result10
-rw-r--r--mysql-test/r/status.result14
-rw-r--r--mysql-test/r/subselect3.result16
-rw-r--r--mysql-test/r/symlink.result10
-rw-r--r--mysql-test/r/thread_cache_size_func.result42
-rw-r--r--mysql-test/r/trigger-trans.result29
-rw-r--r--mysql-test/r/tx_isolation_func.result2
-rw-r--r--mysql-test/r/user_var.result33
-rw-r--r--mysql-test/r/variables.result2
-rw-r--r--mysql-test/r/view.result2
-rw-r--r--mysql-test/r/warnings.result2
-rw-r--r--mysql-test/r/windows.result5
-rw-r--r--mysql-test/r/xa.result20
-rw-r--r--mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_multi_engine.result11
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result47
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_innodb_stat.result16
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result50
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result16
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_row.result71
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test11
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed_simulate.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_multi_engine.test7
-rw-r--r--mysql-test/suite/binlog/t/binlog_start_comment.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_row.test107
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_events.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result12
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc.result23608
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc.result23608
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc.result23607
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0102.result.moved371
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03.result.moved702
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0407.result.moved482
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_08.result.moved538
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_09.result.moved275
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result.moved404
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result (renamed from mysql-test/suite/funcs_1/r/innodb_storedproc.result)3159
-rw-r--r--mysql-test/suite/funcs_1/storedproc/param_check.inc33
-rw-r--r--mysql-test/suite/funcs_1/t/innodb_storedproc.test13
-rw-r--r--mysql-test/suite/funcs_1/t/memory_storedproc.test13
-rw-r--r--mysql-test/suite/funcs_1/t/myisam_storedproc.test13
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc.test13
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_0102.test.moved16
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_03.test.moved16
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_0407.test.moved16
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_08.test.moved16
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_09.test.moved16
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test.moved16
-rw-r--r--mysql-test/suite/funcs_1/t/storedproc.test (renamed from mysql-test/suite/funcs_1/storedproc/storedproc_master.inc)536
-rw-r--r--mysql-test/suite/funcs_1/views/func_view.inc8
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table.result52
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_key.result33
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_range.result6
-rw-r--r--mysql-test/suite/ndb/t/disabled.def1
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table.test29
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_print.test20
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result58
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover.test30
-rw-r--r--mysql-test/suite/parts/inc/partition_alter2_1.inc (renamed from mysql-test/suite/parts/inc/partition_alter2.inc)136
-rw-r--r--mysql-test/suite/parts/inc/partition_alter2_2.inc159
-rw-r--r--mysql-test/suite/parts/inc/partition_auto_increment.inc628
-rw-r--r--mysql-test/suite/parts/inc/partition_directory.inc57
-rw-r--r--mysql-test/suite/parts/inc/partition_mgm.inc25
-rw-r--r--mysql-test/suite/parts/r/ndb_dd_backuprestore.result58
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_innodb.result231
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_myisam.result231
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_ndb.result147
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result539
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result154
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_innodb.result308
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_myisam.result154
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_innodb.result770
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_myisam.result308
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_innodb.result60196
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_maria.result37434
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_myisam.result37434
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_innodb.result (renamed from mysql-test/suite/parts/r/partition_alter2_myisam.result)19321
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_maria.result37643
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_myisam.result37643
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_innodb.result118866
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_innodb.result158
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_myisam.result158
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_innodb.result1886
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_myisam.result1886
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_archive.result807
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_blackhole.result644
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_innodb.result823
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_maria.result868
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_memory.result849
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_myisam.result868
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_ndb.result843
-rw-r--r--mysql-test/suite/parts/r/partition_basic_innodb.result616
-rw-r--r--mysql-test/suite/parts/r/partition_basic_myisam.result308
-rw-r--r--mysql-test/suite/parts/r/partition_basic_symlink_innodb.result10
-rw-r--r--mysql-test/suite/parts/r/partition_basic_symlink_myisam.result453
-rw-r--r--mysql-test/suite/parts/r/partition_bit_innodb.result48
-rw-r--r--mysql-test/suite/parts/r/partition_bit_myisam.result48
-rw-r--r--mysql-test/suite/parts/r/partition_bit_ndb.result27
-rw-r--r--mysql-test/suite/parts/r/partition_char_innodb.result66
-rw-r--r--mysql-test/suite/parts/r/partition_char_myisam.result66
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_innodb.result127
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_myisam.result127
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_innodb.result11
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_myisam.result11
-rw-r--r--mysql-test/suite/parts/r/partition_engine_innodb.result85
-rw-r--r--mysql-test/suite/parts/r/partition_engine_myisam.result85
-rw-r--r--mysql-test/suite/parts/r/partition_engine_ndb.result85
-rw-r--r--mysql-test/suite/parts/r/partition_float_innodb.result22
-rw-r--r--mysql-test/suite/parts/r/partition_float_myisam.result22
-rw-r--r--mysql-test/suite/parts/r/partition_int_innodb.result75
-rw-r--r--mysql-test/suite/parts/r/partition_int_myisam.result75
-rw-r--r--mysql-test/suite/parts/r/partition_int_ndb.result75
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_archive.result200
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result123
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_memory.result123
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result123
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result22
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_archive.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_memory.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result28
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_archive.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_memory.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result122
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result28
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result28
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result28
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_innodb.result69
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_myisam.result69
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result16
-rw-r--r--mysql-test/suite/parts/t/disabled.def1
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_1_innodb.test (renamed from mysql-test/suite/parts/t/partition_alter2_innodb.test)4
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_1_maria.test80
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_1_myisam.test (renamed from mysql-test/suite/parts/t/partition_alter2_myisam.test)4
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_2_innodb.test (renamed from mysql-test/suite/parts/t/partition_alter2_ndb.test)31
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_2_maria.test80
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_2_myisam.test79
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_archive.test40
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_blackhole.test35
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_innodb.test35
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_maria.test35
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_memory.test34
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_myisam.test34
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_ndb.test41
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc0_archive.test1
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result100
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_innodb.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_myisam.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_redirect.result40
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result112
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result112
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result100
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result3
-rw-r--r--mysql-test/suite/rpl/t/disabled.def4
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole.test80
-rw-r--r--mysql-test/suite/rpl/t/rpl_redirect.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test2
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result100
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result100
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result100
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result8
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result100
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result100
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result112
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test5
-rw-r--r--mysql-test/t/alter_table.test40
-rw-r--r--mysql-test/t/auto_increment.test10
-rw-r--r--mysql-test/t/binlog_format_basic.test7
-rw-r--r--mysql-test/t/compare.test9
-rw-r--r--mysql-test/t/create.test5
-rw-r--r--mysql-test/t/ctype_big5.test3
-rw-r--r--mysql-test/t/ctype_ucs.test11
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/distinct.test129
-rw-r--r--mysql-test/t/events_2.test102
-rw-r--r--mysql-test/t/events_bugs.test217
-rw-r--r--mysql-test/t/explain.test47
-rw-r--r--mysql-test/t/federated.test64
-rw-r--r--mysql-test/t/federated_bug_25714.test12
-rw-r--r--mysql-test/t/func_group.test40
-rw-r--r--mysql-test/t/group_by.test29
-rw-r--r--mysql-test/t/information_schema.test8
-rw-r--r--mysql-test/t/information_schema_db.test30
-rw-r--r--mysql-test/t/innodb-semi-consistent.test2
-rw-r--r--mysql-test/t/innodb.test17
-rw-r--r--mysql-test/t/innodb_mysql.test14
-rw-r--r--mysql-test/t/join.test10
-rw-r--r--mysql-test/t/limit.test8
-rw-r--r--mysql-test/t/loaddata.test188
-rw-r--r--mysql-test/t/lock_multi.test321
-rw-r--r--mysql-test/t/log_basic.test4
-rw-r--r--mysql-test/t/log_state.test26
-rw-r--r--mysql-test/t/log_tables.test87
-rw-r--r--mysql-test/t/merge.test25
-rw-r--r--mysql-test/t/metadata.test17
-rw-r--r--mysql-test/t/mysqldump-max.test1058
-rw-r--r--mysql-test/t/mysqldump.test13
-rw-r--r--mysql-test/t/order_by.test20
-rw-r--r--mysql-test/t/outfile.test12
-rw-r--r--mysql-test/t/partition.test110
-rw-r--r--mysql-test/t/partition_innodb.test40
-rw-r--r--mysql-test/t/partition_innodb_stmt.test59
-rw-r--r--mysql-test/t/partition_mgm.test24
-rw-r--r--mysql-test/t/partition_mgm_err.test12
-rw-r--r--mysql-test/t/partition_not_windows.test2
-rw-r--r--mysql-test/t/partition_range.test40
-rw-r--r--mysql-test/t/ps_11bugs.test37
-rw-r--r--mysql-test/t/slow_launch_time_func.test129
-rw-r--r--mysql-test/t/sp-error.test8
-rw-r--r--mysql-test/t/sp.test58
-rw-r--r--mysql-test/t/status.test41
-rw-r--r--mysql-test/t/subselect3.test22
-rw-r--r--mysql-test/t/symlink.test12
-rw-r--r--mysql-test/t/thread_cache_size_func.test148
-rw-r--r--mysql-test/t/trigger-trans.test15
-rw-r--r--mysql-test/t/tx_isolation_func.test2
-rw-r--r--mysql-test/t/user_var.test22
-rw-r--r--mysql-test/t/view.test9
-rwxr-xr-x[-rw-r--r--]mysql-test/t/windows.test1
-rw-r--r--mysql-test/t/xa.test45
-rw-r--r--mysql-test/valgrind.supp9
-rw-r--r--mysys/hash.c138
-rw-r--r--mysys/my_symlink.c17
-rw-r--r--mysys/stacktrace.c67
-rw-r--r--mysys/thr_mutex.c27
-rw-r--r--scripts/make_binary_distribution.sh4
-rw-r--r--scripts/mysql_system_tables_data.sql4
-rw-r--r--scripts/mysqldumpslow.sh2
-rwxr-xr-xsql/CMakeLists.txt14
-rw-r--r--sql/MSG00001.binbin0 -> 184 bytes
-rw-r--r--sql/Makefile.am6
-rw-r--r--sql/event_db_repository.cc14
-rw-r--r--sql/event_parse_data.cc44
-rw-r--r--sql/event_parse_data.h10
-rw-r--r--sql/event_scheduler.cc13
-rw-r--r--sql/field.cc50
-rw-r--r--sql/field.h12
-rw-r--r--sql/ha_ndbcluster.cc25
-rw-r--r--sql/ha_partition.cc832
-rw-r--r--sql/ha_partition.h155
-rw-r--r--sql/handler.cc136
-rw-r--r--sql/handler.h31
-rw-r--r--sql/item.cc77
-rw-r--r--sql/item.h7
-rw-r--r--sql/item_cmpfunc.cc13
-rw-r--r--sql/item_func.cc424
-rw-r--r--sql/item_func.h52
-rw-r--r--sql/item_sum.cc37
-rw-r--r--sql/item_sum.h25
-rw-r--r--sql/key.cc144
-rw-r--r--sql/lock.cc2
-rw-r--r--sql/log.cc11
-rw-r--r--sql/log_event.cc69
-rw-r--r--sql/log_event_old.cc47
-rw-r--r--sql/message.h55
-rw-r--r--sql/message.mc8
-rw-r--r--sql/message.rc2
-rw-r--r--sql/mysql_priv.h5
-rw-r--r--sql/mysqld.cc94
-rw-r--r--sql/opt_range.cc88
-rw-r--r--sql/opt_sum.cc6
-rw-r--r--sql/parse_file.cc24
-rw-r--r--sql/parse_file.h5
-rw-r--r--sql/partition_info.cc10
-rw-r--r--sql/partition_info.h5
-rw-r--r--sql/set_var.cc130
-rw-r--r--sql/set_var.h1
-rw-r--r--sql/share/errmsg.txt18
-rw-r--r--sql/sp_head.cc13
-rw-r--r--sql/sql_base.cc135
-rw-r--r--sql/sql_cache.cc3
-rw-r--r--sql/sql_class.cc88
-rw-r--r--sql/sql_class.h28
-rw-r--r--sql/sql_db.cc17
-rw-r--r--sql/sql_delete.cc6
-rw-r--r--sql/sql_error.cc8
-rw-r--r--sql/sql_insert.cc36
-rw-r--r--sql/sql_lex.cc13
-rw-r--r--sql/sql_lex.h11
-rw-r--r--sql/sql_load.cc4
-rw-r--r--sql/sql_parse.cc131
-rw-r--r--sql/sql_partition.cc324
-rw-r--r--sql/sql_plugin.cc8
-rw-r--r--sql/sql_select.cc41
-rw-r--r--sql/sql_select.h2
-rw-r--r--sql/sql_show.cc68
-rw-r--r--sql/sql_show.h2
-rw-r--r--sql/sql_table.cc168
-rw-r--r--sql/sql_union.cc1
-rw-r--r--sql/sql_update.cc35
-rw-r--r--sql/sql_view.cc30
-rw-r--r--sql/sql_yacc.yy21
-rw-r--r--sql/table.cc24
-rw-r--r--sql/table.h11
-rw-r--r--storage/archive/ha_archive.cc2
-rw-r--r--storage/blackhole/ha_blackhole.cc31
-rw-r--r--storage/blackhole/ha_blackhole.h7
-rw-r--r--support-files/my-huge.cnf.sh3
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh3
-rw-r--r--support-files/my-large.cnf.sh3
-rw-r--r--support-files/my-medium.cnf.sh3
-rw-r--r--support-files/my-small.cnf.sh3
-rw-r--r--support-files/mysql.spec.sh65
-rw-r--r--tests/mysql_client_test.c56
-rwxr-xr-xwin/create_manifest.js12
-rw-r--r--zlib/gzio.c7
400 files changed, 242921 insertions, 214043 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 638fc98a508..7e561e85f58 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -80,7 +80,7 @@ path=`dirname $0`
. "$path/check-cpu"
export AM_MAKEFLAGS
-AM_MAKEFLAGS="-j 4"
+AM_MAKEFLAGS="-j 6"
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out
@@ -105,7 +105,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
cxx_warnings="$cxx_warnings -Wreorder"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
- debug_extra_cflags="-O1 -Wuninitialized"
+ debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized"
else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings"
diff --git a/BUILD/compile-dist b/BUILD/compile-dist
index dcb3732b318..bc907ed2bd0 100755
--- a/BUILD/compile-dist
+++ b/BUILD/compile-dist
@@ -13,35 +13,52 @@ path=`dirname $0`
# Default to gcc for CC and CXX
if test -z "$CXX" ; then
- export CXX=gcc
+ CXX=gcc
# Set some required compile options
if test -z "$CXXFLAGS" ; then
- export CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
+ CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
fi
fi
if test -z "$CC" ; then
- export CC=gcc
+ CC=gcc
fi
# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
- if ! (echo "$CC" | grep "ccache" > /dev/null)
+ if echo "$CC" | grep "ccache" > /dev/null
then
- export CC="ccache $CC"
+ :
+ else
+ CC="ccache $CC"
fi
- if ! (echo "$CXX" | grep "ccache" > /dev/null)
+ if echo "$CXX" | grep "ccache" > /dev/null
then
- export CXX="ccache $CXX"
+ :
+ else
+ CXX="ccache $CXX"
fi
fi
+if test -z "$MAKE"
+then
+ if gmake -v > /dev/null 2>&1
+ then
+ MAKE="gmake"
+ else
+ MAKE="make"
+ fi
+fi
+
+export CC CXX MAKE
+
# Make sure to enable all features that affect "make dist"
# Remember that configure restricts the man pages to the configured features !
./configure \
--with-maria-storage-engine \
--with-embedded-server \
--with-ndbcluster
-make
+$MAKE
+
diff --git a/BUILD/compile-solaris-amd64-forte b/BUILD/compile-solaris-amd64-forte
index 63aceb16c04..03a566a0d12 100644..100755
--- a/BUILD/compile-solaris-amd64-forte
+++ b/BUILD/compile-solaris-amd64-forte
@@ -7,22 +7,23 @@ path=`dirname $0`
. "$path/autorun.sh"
# For "optimal" code for this computer add -fast to EXTRA
-# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
+# To compile 64 bit, add -m64 to EXTRA_64_BIT
-EXTRA_64_BIT="-xarch=amd64"
+EXTRA_64_BIT="-m64"
EXTRA="-fast"
#
# The following should not need to be touched
#
-export CC CXX CFLAGS CXXFLAGS
+export CC CXX CFLAGS CXXFLAGS LIBS
STD="-g -mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
ASFLAGS="$EXTRA_64_BIT"
CC=cc-5.0
CFLAGS="-Xa -xstrconst $STD"
CXX=CC
CXXFLAGS="-noex $STD"
+LIBS=-lmtmalloc
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
diff --git a/BUILD/compile-solaris-amd64-forte-debug b/BUILD/compile-solaris-amd64-forte-debug
index 8e3ade9b429..4b0726bb3ce 100644
--- a/BUILD/compile-solaris-amd64-forte-debug
+++ b/BUILD/compile-solaris-amd64-forte-debug
@@ -6,8 +6,8 @@ gmake -k clean || true
path=`dirname $0`
. "$path/autorun.sh"
-# To compile 64 bit, add -xarch=amd64 to EXTRA_64_BIT
-EXTRA_64_BIT="-xarch=amd64"
+# To compile 64 bit, add -m64 to EXTRA_64_BIT
+EXTRA_64_BIT="-m64"
# For "optimal" code for this computer add -fast to EXTRA. Note that
# this causes problem with debugging the program since -fast implies
diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc
index 5132965d766..b287baa6845 100755
--- a/BUILD/compile-solaris-sparc
+++ b/BUILD/compile-solaris-sparc
@@ -9,6 +9,6 @@ PATH=$PATH:/usr/ccs/bin:/usr/local/bin
path=`dirname $0`
. "$path/autorun.sh"
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
make -j 4
diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte
index b9fffcb7fdd..f4bf86517d1 100755
--- a/BUILD/compile-solaris-sparc-forte
+++ b/BUILD/compile-solaris-sparc-forte
@@ -29,7 +29,7 @@ EXTRA="-fast" # Remove comment to target current machine
STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \
-CXX=CC CXXFLAGS="-noex $STD" \
+CXX=CC CXXFLAGS="-noex $STD" LIBS="-lmtmalloc" \
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --prefix=$PREFIX
make -j 4
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 58959f56a89..c068b2ff16e 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2396,8 +2396,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
fprintf(sql_file, ",\n %s %s",
quote_name(row[0], name_buff, 0), row[1]);
}
+
+ /*
+ Stand-in tables are always MyISAM tables as the default
+ engine might have a column-limit that's lower than the
+ number of columns in the view, and MyISAM support is
+ guaranteed to be in the server anyway.
+ */
fprintf(sql_file,
- "\n) */;\n"
+ "\n) ENGINE=MyISAM */;\n"
"SET character_set_client = @saved_cs_client;\n");
check_io(sql_file);
diff --git a/configure.in b/configure.in
index b202c1b480a..3636398abc2 100644
--- a/configure.in
+++ b/configure.in
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.30-maria-alpha)
+AM_INIT_AUTOMAKE(mysql, 5.1.31-maria-alpha)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
@@ -403,12 +403,15 @@ dnl Find paths to some shell programs
AC_PATH_PROG(LN, ln, ln)
# This must be able to take a -f flag like normal unix ln.
AC_PATH_PROG(LN_CP_F, ln, ln)
-if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
-# If ln -f does not exists use -s (AFS systems)
-if test -n "$LN_CP_F"; then
- LN_CP_F="$LN_CP_F -s"
-fi
-fi
+case $SYSTEM_TYPE in
+ *netware*) ;;
+ *)
+ # If ln -f does not exists use -s (AFS systems)
+ if test -n "$LN_CP_F"; then
+ LN_CP_F="$LN_CP_F -s"
+ fi
+ ;;
+esac
AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(RM, rm, rm)
@@ -453,46 +456,50 @@ fi
AC_SUBST(ABI_CHECK)
-# Lock for PS
+# Look for PS usage. We use double dollar-signs in FIND_PROC because this
+# value is written to a makefile, which interprets away one level of
+# dollar-signs. So, interpretation stages are m4 and then shell in autoconf,
+# then Make, then shell. The autoconf substitution uses single quotes, so
+# no unprotected single quotes should appear in the expression.
AC_PATH_PROG(PS, ps, ps)
AC_MSG_CHECKING("how to check if pid exists")
PS=$ac_cv_path_PS
# Linux style
-if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
+if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null
then
- FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
+ FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
# Solaris
-elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
+elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null
then
- FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
+ FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
# BSD style
-elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
+elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null
then
- FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
+ FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
# SysV style
-elif $PS -ef 2> /dev/null | grep $0 > /dev/null
+elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null
then
- FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
+ FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
# Do anybody use this?
-elif $PS $$ 2> /dev/null | grep $0 > /dev/null
+elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null
then
- FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
+ FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
else
case $SYSTEM_TYPE in
*freebsd*|*dragonfly*)
- FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
+ FIND_PROC="$PS p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
;;
*darwin*)
- FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
+ FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
;;
*cygwin*)
- FIND_PROC="$PS -e | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
+ FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
;;
*netware*)
FIND_PROC=
;;
*)
- AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
+ AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.])
esac
fi
AC_SUBST(FIND_PROC)
@@ -1636,14 +1643,16 @@ else
OPTIMIZE_CXXFLAGS="-O"
fi
-if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
- DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
- DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
- DEBUG_OPTIMIZE_CC="-DDEBUG"
- DEBUG_OPTIMIZE_CXX="-DDEBUG"
- OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
- OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
-fi
+case $SYSTEM_TYPE in
+ *netware*)
+ DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
+ DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
+ DEBUG_OPTIMIZE_CC="-DDEBUG"
+ DEBUG_OPTIMIZE_CXX="-DDEBUG"
+ OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
+ OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
+ ;;
+esac
# If the user specified CFLAGS, we won't add any optimizations
if test -n "$SAVE_CFLAGS"
@@ -1911,15 +1920,18 @@ MYSQL_TZNAME
# Do the c++ compiler have a bool type
MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc
-if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
-MYSQL_CHECK_LONGLONG_TO_FLOAT
-if test "$ac_cv_conv_longlong_to_float" != "yes"
-then
- AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
-If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
-again])
-fi
-fi
+case $SYSTEM_TYPE in
+ *netware*) ;;
+ *)
+ MYSQL_CHECK_LONGLONG_TO_FLOAT
+ if test "$ac_cv_conv_longlong_to_float" != "yes"
+ then
+ AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
+ If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
+ again])
+ fi
+ ;;
+esac
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
AC_CHECK_TYPES([u_int32_t])
@@ -2036,7 +2048,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
- pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
+ pthread_key_delete pthread_rwlock_rdlock pthread_setprio pthread_setschedprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
@@ -2556,11 +2568,12 @@ readline_h_ln_cmd=""
readline_link=""
want_to_use_readline="no"
-if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
-then
+case $SYSTEM_TYPE in
+ *netware*)
# For NetWare, do not need readline
echo "Skipping readline"
-else
+ ;;
+ *)
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
then
readline_topdir="cmd-line-utils"
@@ -2613,7 +2626,8 @@ else
be built with libreadline. Please use --with-libedit to use
the bundled version of libedit instead.])
fi
-fi
+ ;;
+esac
AC_SUBST(readline_dir)
AC_SUBST(readline_topdir)
@@ -2721,6 +2735,9 @@ then
fi
AM_CONDITIONAL(THREAD, test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no")
+# "innochecksum" is not in the "innobase/" subdirectory, but should be switched
+AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes])
+
# IMPORTANT - do not modify LIBS past this line - this hack is the only way
# I know to add the static NSS magic if we have static NSS libraries with
# glibc - Sasha
diff --git a/extra/Makefile.am b/extra/Makefile.am
index cdce7a170e2..0ef679edcac 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -44,7 +44,12 @@ $(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h
$(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h
bin_PROGRAMS = replace perror resolveip my_print_defaults \
- resolve_stack_dump mysql_waitpid innochecksum
+ resolve_stack_dump mysql_waitpid
+# "innochecksum" should be switched
+if BUILD_INNODB_TOOLS
+bin_PROGRAMS += innochecksum
+endif
+
noinst_PROGRAMS = charset2html
EXTRA_DIST = CMakeLists.txt
diff --git a/include/Makefile.am b/include/Makefile.am
index 8a4ba472530..6ace3b6acf8 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -15,8 +15,9 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
-BUILT_SOURCES = $(HEADERS_GEN) link_sources
-HEADERS_GEN = mysql_version.h my_config.h
+BUILT_SOURCES = $(HEADERS_GEN_MAKE) link_sources
+HEADERS_GEN_CONFIGURE = mysql_version.h
+HEADERS_GEN_MAKE = my_config.h
HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
my_list.h my_alloc.h typelib.h mysql/plugin.h
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
@@ -25,7 +26,9 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
- m_ctype.h my_attribute.h $(HEADERS_GEN)
+ m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
+ $(HEADERS_GEN_MAKE)
+
noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
heap.h maria.h myisamchk.h my_bitmap.h my_uctype.h \
myisam.h myisampack.h myisammrg.h ft_global.h\
@@ -33,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
- mysql_version.h.in my_handler.h my_time.h \
+ my_handler.h my_time.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \
@@ -45,7 +48,7 @@ CLEANFILES = $(BUILT_SOURCES) readline openssl
# Some include files that may be moved and patched by configure
-DISTCLEANFILES = sched.h $(CLEANFILES)
+DISTCLEANFILES = sched.h $(CLEANFILES) $(HEADERS_GEN_CONFIGURE)
link_sources:
-$(RM) -f readline openssl
diff --git a/include/hash.h b/include/hash.h
index 4ca8dc0e8bf..1f094d48585 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -22,6 +22,40 @@ extern "C" {
#endif
/*
+ There was a problem on MacOSX with a shared object ha_example.so.
+ It used hash_search(). During build of ha_example.so no libmysys
+ was specified. Since MacOSX had a hash_search() in the system
+ library, it built the shared object so that the dynamic linker
+ linked hash_search() to the system library, which caused a crash
+ when called. To come around this, we renamed hash_search() to
+ my_hash_search(), as we did long ago with hash_insert() and
+ hash_reset(). However, this time we made the move complete with
+ all names. To keep compatibility, we redefine the old names.
+ Since every C and C++ file, that uses HASH, needs to include
+ this file, the change is complete. Both names could be used
+ in the code, but the my_* versions are recommended now.
+*/
+#define hash_get_key my_hash_get_key
+#define hash_free_key my_hash_free_key
+#define hash_init my_hash_init
+#define hash_init2 my_hash_init2
+#define _hash_init _my_hash_init
+#define hash_free my_hash_free
+#define hash_reset my_hash_reset
+#define hash_element my_hash_element
+#define hash_search my_hash_search
+#define hash_first my_hash_first
+#define hash_next my_hash_next
+#define hash_insert my_hash_insert
+#define hash_delete my_hash_delete
+#define hash_update my_hash_update
+#define hash_replace my_hash_replace
+#define hash_check my_hash_check
+#define hash_clear my_hash_clear
+#define hash_inited my_hash_inited
+#define hash_init_opt my_hash_init_opt
+
+/*
Overhead to store an element in hash
Can be used to approximate memory consumption for a hash
*/
@@ -30,8 +64,8 @@ extern "C" {
/* flags for hash_init */
#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
-typedef uchar *(*hash_get_key)(const uchar *,size_t*,my_bool);
-typedef void (*hash_free_key)(void *);
+typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
+typedef void (*my_hash_free_key)(void *);
typedef struct st_hash {
size_t key_offset,key_length; /* Length of key if const length */
@@ -39,7 +73,7 @@ typedef struct st_hash {
ulong records;
uint flags;
DYNAMIC_ARRAY array; /* Place for hash_keys */
- hash_get_key get_key;
+ my_hash_get_key get_key;
void (*free)(void *);
CHARSET_INFO *charset;
} HASH;
@@ -47,30 +81,34 @@ typedef struct st_hash {
/* A search iterator state */
typedef uint HASH_SEARCH_STATE;
-#define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO)
-#define hash_init2(A,B,C,D,E,F,G,H,I) _hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO)
-my_bool _hash_init(HASH *hash, uint growth_size,CHARSET_INFO *charset,
- ulong default_array_elements, size_t key_offset,
- size_t key_length, hash_get_key get_key,
- void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
-void hash_free(HASH *tree);
+#define my_hash_init(A,B,C,D,E,F,G,H) \
+ _my_hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO)
+#define my_hash_init2(A,B,C,D,E,F,G,H,I) \
+ _my_hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO)
+my_bool _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset,
+ ulong default_array_elements, size_t key_offset,
+ size_t key_length, my_hash_get_key get_key,
+ void (*free_element)(void*),
+ uint flags CALLER_INFO_PROTO);
+void my_hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
-uchar *hash_element(HASH *hash,ulong idx);
-uchar *hash_search(const HASH *info, const uchar *key, size_t length);
-uchar *hash_first(const HASH *info, const uchar *key, size_t length,
- HASH_SEARCH_STATE *state);
-uchar *hash_next(const HASH *info, const uchar *key, size_t length,
- HASH_SEARCH_STATE *state);
-my_bool my_hash_insert(HASH *info,const uchar *data);
-my_bool hash_delete(HASH *hash,uchar *record);
-my_bool hash_update(HASH *hash,uchar *record,uchar *old_key,size_t old_key_length);
-void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
-my_bool hash_check(HASH *hash); /* Only in debug library */
+uchar *my_hash_element(HASH *hash, ulong idx);
+uchar *my_hash_search(const HASH *info, const uchar *key, size_t length);
+uchar *my_hash_first(const HASH *info, const uchar *key, size_t length,
+ HASH_SEARCH_STATE *state);
+uchar *my_hash_next(const HASH *info, const uchar *key, size_t length,
+ HASH_SEARCH_STATE *state);
+my_bool my_hash_insert(HASH *info, const uchar *data);
+my_bool my_hash_delete(HASH *hash, uchar *record);
+my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key,
+ size_t old_key_length);
+void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
+my_bool my_hash_check(HASH *hash); /* Only in debug library */
-#define hash_clear(H) bzero((char*) (H),sizeof(*(H)))
-#define hash_inited(H) ((H)->array.buffer != 0)
-#define hash_init_opt(A,B,C,D,E,F,G,H) \
- (!hash_inited(A) && _hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
+#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
+#define my_hash_inited(H) ((H)->array.buffer != 0)
+#define my_hash_init_opt(A,B,C,D,E,F,G,H) \
+ (!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
#ifdef __cplusplus
}
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 9df8a9e6a65..a9f1af85e13 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -284,6 +284,8 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
#elif defined(HAVE_PTHREAD_SETPRIO)
#define my_pthread_setprio(A,B) pthread_setprio((A),(B))
+#elif defined(HAVE_PTHREAD_SETSCHEDPRIO)
+#define my_pthread_setprio(A,B) pthread_setschedprio((A),(B))
#else
extern void my_pthread_setprio(pthread_t thread_id,int prior);
#endif
@@ -525,6 +527,7 @@ typedef struct st_my_pthread_fastmutex_t
{
pthread_mutex_t mutex;
uint spins;
+ uint rng_state;
} my_pthread_fastmutex_t;
void fastmutex_global_init(void);
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 821c1bf2949..cf27527cad4 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -29,6 +29,14 @@ extern ulong locks_immediate,locks_waited ;
enum thr_lock_type { TL_IGNORE=-1,
TL_UNLOCK, /* UNLOCK ANY LOCK */
+ /*
+ Parser only! At open_tables() becomes TL_READ or
+ TL_READ_NO_INSERT depending on the binary log format
+ (SBR/RBR) and on the table category (log table).
+ Used for tables that are read by statements which
+ modify tables.
+ */
+ TL_READ_DEFAULT,
TL_READ, /* Read lock */
TL_READ_WITH_SHARED_LOCKS,
/* High prior. than TL_WRITE. Allow concurrent insert */
diff --git a/man/Makefile.am b/man/Makefile.am
index 2d47a1ad9ba..f21034d5535 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -21,5 +21,9 @@ man1_MANS = @man1_files@
man8_MANS = @man8_files@
EXTRA_DIST = $(man1_MANS) $(man8_MANS)
+# "make_win_*" are not needed in Unix binary packages,
+install-data-hook:
+ rm -f $(DESTDIR)$(manlibdir)/man1/make_win_*
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index 48fc5a81c7b..98bd116ba29 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -125,6 +125,45 @@ drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
+
+#
+# Bug #39182: Binary log producing incompatible character set query from
+# stored procedure.
+#
+reset master;
+CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+USE bug39182;
+CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+ DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DELIMITER //;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE s1 VARCHAR(255);
+ SET s1= "test";
+ CREATE TEMPORARY TABLE tmp1
+ SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+ SELECT
+ COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+ COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+ COLLATION(s1) c3,
+ COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+ COERCIBILITY(s1) d3;
+ DROP TEMPORARY TABLE tmp1;
+END//
+
+DELIMITER ;//
+
+CALL p1();
+source include/show_binlog_events.inc;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP DATABASE bug39182;
+USE test;
+
--echo End of 5.0 tests
# Test of a too big SET INSERT_ID: see if the truncated value goes
diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test
index 2d63ae27aa3..e8671ed2da0 100644
--- a/mysql-test/extra/binlog_tests/blackhole.test
+++ b/mysql-test/extra/binlog_tests/blackhole.test
@@ -139,15 +139,6 @@ drop table t1,t2,t3;
# table
#
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
-# NOTE: After exchanging open_ltable() by open_and_lock_tables() in
-# handle_delayed_insert() to fix problems with MERGE tables (Bug#26379),
-# problems with INSERT DELAYED and BLACKHOLE popped up. open_ltable()
-# does not check if the binlogging capabilities of the statement and the
-# table match. So the below used to succeed. But since INSERT DELAYED
-# switches to row-based logging in mixed-mode and BLACKHOLE cannot do
-# row-based logging, it could not really work. Until this problem is
-# correctly fixed, we have that error here.
---error ER_BINLOG_LOGGING_IMPOSSIBLE
INSERT DELAYED INTO t1 VALUES(1);
DROP TABLE t1;
diff --git a/mysql-test/extra/binlog_tests/innodb_stat.test b/mysql-test/extra/binlog_tests/innodb_stat.test
index 4638dfcd2f7..b31e99dfe71 100644
--- a/mysql-test/extra/binlog_tests/innodb_stat.test
+++ b/mysql-test/extra/binlog_tests/innodb_stat.test
@@ -7,6 +7,7 @@
# Actually this test has nothing to do with innodb per se, it just requires
# transactional table.
#
+flush status;
show status like "binlog_cache_use";
show status like "binlog_cache_disk_use";
--disable_warnings
@@ -38,12 +39,3 @@ commit;
show status like "binlog_cache_use";
show status like "binlog_cache_disk_use";
drop table t1;
-
-# Test for testable InnoDB status variables. This test
-# uses previous ones(pages_created, rows_deleted, ...).
-show status like "Innodb_buffer_pool_pages_total";
-show status like "Innodb_page_size";
-show status like "Innodb_rows_deleted";
-show status like "Innodb_rows_inserted";
-show status like "Innodb_rows_updated";
-
diff --git a/mysql-test/extra/rpl_tests/rpl_EE_err.test b/mysql-test/extra/rpl_tests/rpl_EE_err.test
index 3dce12b3f4e..b7b393c3d6f 100644
--- a/mysql-test/extra/rpl_tests/rpl_EE_err.test
+++ b/mysql-test/extra/rpl_tests/rpl_EE_err.test
@@ -20,7 +20,7 @@
eval create table t1 (a int) engine=$engine_type;
flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
drop table if exists t1;
save_master_pos;
connection slave;
diff --git a/mysql-test/extra/rpl_tests/rpl_blackhole.test b/mysql-test/extra/rpl_tests/rpl_blackhole.test
new file mode 100644
index 00000000000..1a0eeb3cf15
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_blackhole.test
@@ -0,0 +1,32 @@
+# Check replication of one statement assuming that the engine on the
+# slave is a blackhole engine.
+
+# Input:
+# $statement Statement to evaluate, it is assumed to change t1
+
+# 1. Evaluate statement on master, it is assumed to change t1
+# 2. Wait for statement to be processed on slave
+# 3. SELECT from table t1 to see what was written
+# 4. Compare position on slave before executing statement and after
+# executing statement. If difference is >0, then something was
+# written to the binary log on the slave.
+
+connection slave;
+let $before = query_get_value("SHOW MASTER STATUS", Position, 1);
+
+--echo [on master]
+connection master;
+eval $statement;
+
+--echo [on slave]
+sync_slave_with_master;
+--echo # Expect 0
+SELECT COUNT(*) FROM t1;
+let $after = query_get_value("SHOW MASTER STATUS", Position, 1);
+let $something_written = `select $after - $before != 0`;
+if ($something_written) {
+ --echo >>> Something was written to binary log <<<
+}
+if (!$something_written) {
+ --echo >>> Nothing was written to binary log <<<
+}
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test
index d8ea267d62b..bd815d9de02 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test
@@ -442,8 +442,6 @@ SELECT f1();
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
INSERT INTO t1 VALUES (NULL, f2());
-INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)),
- (NULL, @@LAST_INSERT_ID);
# Test replication of substitution "IS NULL" -> "= LAST_INSERT_ID".
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
UPDATE t1 SET j= -1 WHERE i IS NULL;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index 7cfbcdb4437..0ba27c69a55 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -471,3 +471,184 @@ source include/diff_tables.inc;
connection master;
drop table t1;
sync_slave_with_master;
+
+#
+# Bug #38230 Differences between master and slave after
+# UPDATE or DELETE with LIMIT with pk
+#
+# the regression test verifies consistency via selecting
+
+--disable_abort_on_error
+
+--connection master
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `int_nokey` int(11) NOT NULL,
+ `int_key` int(11) NOT NULL,
+ `date_key` date NOT NULL,
+ `date_nokey` date NOT NULL,
+ `time_key` time NOT NULL,
+ `time_nokey` time NOT NULL,
+ `datetime_key` datetime NOT NULL,
+ `datetime_nokey` datetime NOT NULL,
+ `varchar_key` varchar(1) NOT NULL,
+ `varchar_nokey` varchar(1) NOT NULL,
+ PRIMARY KEY (`pk`),
+ KEY `int_key` (`int_key`),
+ KEY `date_key` (`date_key`),
+ KEY `time_key` (`time_key`),
+ KEY `datetime_key` (`datetime_key`),
+ KEY `varchar_key` (`varchar_key`)
+) ENGINE=$type;
+
+INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
+
+eval CREATE TABLE t2 (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `int_nokey` int(11) NOT NULL,
+ `int_key` int(11) NOT NULL,
+ `date_key` date NOT NULL,
+ `date_nokey` date NOT NULL,
+ `time_key` time NOT NULL,
+ `time_nokey` time NOT NULL,
+ `datetime_key` datetime NOT NULL,
+ `datetime_nokey` datetime NOT NULL,
+ `varchar_key` varchar(1) NOT NULL,
+ `varchar_nokey` varchar(1) NOT NULL,
+ PRIMARY KEY (`pk`),
+ KEY `int_key` (`int_key`),
+ KEY `date_key` (`date_key`),
+ KEY `time_key` (`time_key`),
+ KEY `datetime_key` (`datetime_key`),
+ KEY `varchar_key` (`varchar_key`)
+) ENGINE=$type;
+
+INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
+
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
+DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
+UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+
+--sync_slave_with_master
+--echo *** results: t2 must be consistent ****
+
+let $diff_table_1=master:test.t2;
+let $diff_table_2=master:test.t2;
+source include/diff_tables.inc;
+
+--connection master
+DROP TABLE t1, t2;
+
+--enable_abort_on_error
+
+--echo EOF OF TESTS
+
+#
+# BUG#40004: Replication failure with no PK + no indexes
+#
+
+# The test cases are taken from the bug report. It is difficult to
+# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
+# with the test cases we have.
+
+connection master;
+
+eval CREATE TABLE t1 (a int) ENGINE=$type;
+
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 2 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 5 );
+
+UPDATE t1 SET a = 5 WHERE a = 9;
+DELETE FROM t1 WHERE a < 6;
+UPDATE t1 SET a = 9 WHERE a < 3;
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a < 4;
+UPDATE t1 SET a = 8 WHERE a < 5;
+
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+#
+# Bug #39752: Replication failure on RBR + MyISAM + no PK
+#
+
+# The test cases are taken from the bug report. It is difficult to
+# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
+# with the test cases we have.
+
+connection master;
+
+--disable_warnings
+eval CREATE TABLE t1 (a bit) ENGINE=$type;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+DELETE FROM t1 WHERE a < 2 LIMIT 4;
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 9 );
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 8 );
+UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
+INSERT INTO t1 ( a ) VALUES ( 4 );
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
+DELETE FROM t1 WHERE a = 4 LIMIT 7;
+UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
+UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
+DELETE FROM t1 WHERE a < 0 LIMIT 5;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
+DELETE FROM t1 WHERE a < 8 LIMIT 8;
+INSERT INTO t1 ( a ) VALUES ( 6 );
+DELETE FROM t1 WHERE a < 6 LIMIT 7;
+UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+INSERT INTO t1 ( a ) VALUES ( 6 );
+UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
+DELETE FROM t1 WHERE a = 2 LIMIT 9;
+DELETE FROM t1 WHERE a = 1 LIMIT 4;
+UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
+INSERT INTO t1 ( a ) VALUES ( 0 );
+DELETE FROM t1 WHERE a < 3 LIMIT 0;
+UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
+INSERT INTO t1 ( a ) VALUES ( 1 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+--enable_warnings
+
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index 2ecdbe583c2..023d582065e 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -487,3 +487,18 @@ select * from t2 where a=4 or b=4;
drop table t1, t2;
+#
+# Bug #37943: Reproducible mysqld crash/sigsegv in sel_trees_can_be_ored
+#
+
+CREATE TABLE t1 (a varchar(8), b set('a','b','c','d','e','f','g','h'),
+ KEY b(b), KEY a(a));
+INSERT INTO t1 VALUES ('y',''), ('z','');
+
+#should not crash
+SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
+ (a='pure-S') OR (a='DE80337a') OR (a='DE80799');
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index f4e9cf74b72..d2332edd5dc 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -1256,6 +1256,7 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+set binlog_format=mixed;
--echo # Switch to connection con1
connection con1;
diff --git a/mysql-test/include/ndb_backup_print.inc b/mysql-test/include/ndb_backup_print.inc
index 57fb279491c..7527f125686 100644
--- a/mysql-test/include/ndb_backup_print.inc
+++ b/mysql-test/include/ndb_backup_print.inc
@@ -1,6 +1,7 @@
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat
--exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat
---exec rm -f $MYSQLTEST_VARDIR/tmp/tmp.dat
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/tmp/tmp.dat
--let ndb_restore_opts=
--let ndb_restore_filter=
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 96cd2a898be..1bb793fba49 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -433,41 +433,51 @@ sub optimize_cases {
# Skip processing if already marked as skipped
next if $tinfo->{skip};
- # Replication test needs an adjustment of binlog format
- if (mtr_match_prefix($tinfo->{'name'}, "rpl"))
+ # =======================================================
+ # If a special binlog format was selected with
+ # --mysqld=--binlog-format=x, skip all test that does not
+ # support it
+ # =======================================================
+ #print "used_binlog_format: $::used_binlog_format\n";
+ if (defined $::used_binlog_format )
{
-
# =======================================================
- # Get binlog-format used by this test from master_opt
+ # Fixed --binlog-format=x specified on command line
# =======================================================
- my $test_binlog_format;
- foreach my $opt ( @{$tinfo->{master_opt}} ) {
- $test_binlog_format= $test_binlog_format ||
- mtr_match_prefix($opt, "--binlog-format=");
- }
- # print $tinfo->{name}." uses ".$test_binlog_format."\n";
+ if ( defined $tinfo->{'binlog_formats'} )
+ {
+ #print "binlog_formats: ". join(", ", @{$tinfo->{binlog_formats}})."\n";
+ # The test supports different binlog formats
+ # check if the selected one is ok
+ my $supported=
+ grep { $_ eq $::used_binlog_format } @{$tinfo->{'binlog_formats'}};
+ if ( !$supported )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}=
+ "Doesn't support --binlog-format='$::used_binlog_format'";
+ }
+ }
+ }
+ else
+ {
# =======================================================
- # If a special binlog format was selected with
- # --mysqld=--binlog-format=x, skip all test with different
- # binlog-format
+ # Use dynamic switching of binlog format
# =======================================================
- if (defined $::used_binlog_format and
- $test_binlog_format and
- $::used_binlog_format ne $test_binlog_format)
- {
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "Requires --binlog-format='$test_binlog_format'";
- next;
+
+ # Get binlog-format used by this test from master_opt
+ my $test_binlog_format;
+ foreach my $opt ( @{$tinfo->{master_opt}} ) {
+ $test_binlog_format=
+ mtr_match_prefix($opt, "--binlog-format=") || $test_binlog_format;
}
- # =======================================================
- # Check that testcase supports the designated binlog-format
- # =======================================================
- if ($test_binlog_format and defined $tinfo->{'sup_binlog_formats'} )
+ if (defined $test_binlog_format and
+ defined $tinfo->{binlog_formats} )
{
my $supported=
- grep { $_ eq $test_binlog_format } @{$tinfo->{'sup_binlog_formats'}};
+ grep { $_ eq $test_binlog_format } @{$tinfo->{'binlog_formats'}};
if ( !$supported )
{
$tinfo->{'skip'}= 1;
@@ -476,20 +486,8 @@ sub optimize_cases {
next;
}
}
-
- # =======================================================
- # Use dynamic switching of binlog-format if mtr started
- # w/o --mysqld=--binlog-format=xxx and combinations.
- # =======================================================
- if (!defined $tinfo->{'combination'} and
- !defined $::used_binlog_format)
- {
- $test_binlog_format= $tinfo->{'sup_binlog_formats'}->[0];
- }
-
- # Save binlog format for dynamic switching
- $tinfo->{binlog_format}= $test_binlog_format;
}
+
}
}
@@ -870,18 +868,19 @@ sub collect_one_test_case($$$$$$$$$) {
# the specified value in "tinfo"
our @tags=
(
- ["include/have_innodb.inc", "innodb_test", 1],
- ["include/have_binlog_format_row.inc", "sup_binlog_formats", ["row"]],
- ["include/have_log_bin.inc", "need_binlog", 1],
- ["include/have_binlog_format_statement.inc",
- "sup_binlog_formats", ["statement"]],
- ["include/have_binlog_format_mixed.inc", "sup_binlog_formats", ["mixed"]],
+
+ ["include/have_binlog_format_row.inc", "binlog_formats", ["row"]],
+ ["include/have_binlog_format_statement.inc", "binlog_formats", ["statement"]],
+ ["include/have_binlog_format_mixed.inc", "binlog_formats", ["mixed"]],
["include/have_binlog_format_mixed_or_row.inc",
- "sup_binlog_formats", ["mixed","row"]],
+ "binlog_formats", ["mixed", "row"]],
["include/have_binlog_format_mixed_or_statement.inc",
- "sup_binlog_formats", ["mixed","statement"]],
+ "binlog_formats", ["mixed", "statement"]],
["include/have_binlog_format_row_or_statement.inc",
- "sup_binlog_formats", ["row","statement"]],
+ "binlog_formats", ["row", "statement"]],
+
+ ["include/have_innodb.inc", "innodb_test", 1],
+ ["include/have_log_bin.inc", "need_binlog", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index 041bca2b884..0ceb6452438 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -312,7 +312,7 @@ sub mtr_report_stats ($) {
/Slave: According to the master's version/ or
/Slave: Column [0-9]* type mismatch/ or
/Slave: Error .* doesn't exist/ or
- /Slave: Error .*Deadlock found/ or
+ /Slave: Deadlock found/ or
/Slave: Error .*Unknown table/ or
/Slave: Error in Write_rows event: / or
/Slave: Field .* of table .* has no default value/ or
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 81365e1df7e..7658b73a6aa 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3663,7 +3663,16 @@ sub run_testcase ($) {
{
mtr_timer_stop_all($glob_timers);
mtr_report("\nServers started, exiting");
- exit(0);
+ if ($glob_win32_perl)
+ {
+ #ActiveState perl hangs when using normal exit, use POSIX::_exit instead
+ use POSIX qw[ _exit ];
+ POSIX::_exit(0);
+ }
+ else
+ {
+ exit(0);
+ }
}
{
@@ -4429,19 +4438,10 @@ sub run_testcase_need_master_restart($)
elsif (! mtr_same_opts($master->[0]->{'start_opts'},
$tinfo->{'master_opt'}) )
{
- # Chech that diff is binlog format only
- my $diff_opts= mtr_diff_opts($master->[0]->{'start_opts'},$tinfo->{'master_opt'});
- if (scalar(@$diff_opts) eq 2)
- {
- $do_restart= 1 unless ($diff_opts->[0] =~/^--binlog-format=/ and $diff_opts->[1] =~/^--binlog-format=/);
- }
- else
- {
- $do_restart= 1;
- mtr_verbose("Restart master: running with different options '" .
- join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
+ $do_restart= 1;
+ mtr_verbose("Restart master: running with different options '" .
+ join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
- }
}
elsif( ! $master->[0]->{'pid'} )
{
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 24dd90475c8..b3b2d5d6235 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1222,4 +1222,34 @@ ALTER TABLE t1 CHANGE d c varchar(10);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
+create table t1(f1 int not null, f2 int not null, key (f1), key (f2));
+select index_length into @unpaked_keys_size from
+information_schema.tables where table_name='t1';
+alter table t1 pack_keys=1;
+select index_length into @paked_keys_size from
+information_schema.tables where table_name='t1';
+select (@unpaked_keys_size > @paked_keys_size);
+(@unpaked_keys_size > @paked_keys_size)
+1
+select max_data_length into @orig_max_data_length from
+information_schema.tables where table_name='t1';
+alter table t1 max_rows=100;
+select max_data_length into @changed_max_data_length from
+information_schema.tables where table_name='t1';
+select (@orig_max_data_length > @changed_max_data_length);
+(@orig_max_data_length > @changed_max_data_length)
+1
+drop table t1;
+CREATE TABLE t1(a INT AUTO_INCREMENT PRIMARY KEY,
+b ENUM('a', 'b', 'c') NOT NULL);
+INSERT INTO t1 (b) VALUES ('a'), ('c'), ('b'), ('b'), ('a');
+ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL;
+SELECT * FROM t1;
+a b
+1 a
+2 c
+3 b
+4 b
+5 a
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index bc9daf43f14..a39b424827c 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -454,3 +454,11 @@ select last_insert_id();
last_insert_id()
3
drop table t1;
+create table t1 (a int primary key auto_increment, b int, c int, e int, d timestamp default current_timestamp, unique(b),unique(c),unique(e));
+insert into t1 values(null,1,1,1,now());
+insert into t1 values(null,0,0,0,null);
+replace into t1 values(null,1,0,2,null);
+select last_insert_id();
+last_insert_id()
+3
+drop table t1;
diff --git a/mysql-test/r/binlog_format_basic.result b/mysql-test/r/binlog_format_basic.result
index 3fee9bade7e..72ba35cd753 100644
--- a/mysql-test/r/binlog_format_basic.result
+++ b/mysql-test/r/binlog_format_basic.result
@@ -1,3 +1,6 @@
+SELECT @@GLOBAL.binlog_format;
+@@GLOBAL.binlog_format
+STATEMENT
'#---------------------BS_STVARS_002_01----------------------#'
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index 44c258d7611..f9563b89b76 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -90,4 +90,9 @@ Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
DROP TABLE t1,t2;
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
+SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
+a
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index a64f0a06098..b8ea0915c80 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1559,6 +1559,8 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
DROP TABLE t1;
+create user mysqltest_1@'test@test';
+ERROR HY000: Malformed hostname (illegal symbol: '@')
CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
INSERT IGNORE INTO t1 (b) VALUES (5);
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index ff6957202d7..0cd2d395ebc 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -40,9 +40,9 @@ IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
-master-bin.000001 784 Query 1 992 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
-master-bin.000001 992 Query 1 1081 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1081 Query 1 1160 use `test`; DROP TABLE t4
+master-bin.000001 784 Query 1 1048 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
+master-bin.000001 1048 Query 1 1137 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1137 Query 1 1216 use `test`; DROP TABLE t4
End of 5.0 tests
SHOW BINLOG EVENTS FROM 364;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 20dd85834dd..ec2182a3304 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -1098,6 +1098,17 @@ ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_gen
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
drop table t1;
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET UCS2);
+INSERT INTO t1 VALUES ('a');
+SET @@sql_mode=pad_char_to_full_length;
+SELECT HEX(s1) FROM t1;
+HEX(s1)
+00610020002000200020
+SET @@sql_mode=default;
+SELECT HEX(s1) FROM t1;
+HEX(s1)
+0061
+DROP TABLE t1;
set collation_connection=ucs2_general_ci;
drop table if exists t1;
create table t1 as
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index 1fbda27f5da..6a06a9661aa 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -608,6 +608,65 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
a a
DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+INSERT INTO t1 VALUES (1,1,'ORANGE');
+INSERT INTO t1 VALUES (2,2,'APPLE');
+INSERT INTO t1 VALUES (3,2,'APPLE');
+INSERT INTO t1 VALUES (4,3,'PEAR');
+SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
+'APPLE';
+SELECT @v1, @v2;
+@v1 @v2
+2 APPLE
+SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
+fruit_name HAVING fruit_name = 'APPLE';
+SELECT @v3, @v4;
+@v3 @v4
+2 APPLE
+SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
+fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8;
+@v5 @v6 @v7 @v8
+3 PEAR 3 PEAR
+SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
+WHERE fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8, @v9, @v10;
+@v5 @v6 @v7 @v8 @v9 @v10
+3 PEAR 3 PEAR 5 PEARAPPLE
+SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
+@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v11, @v12, @v13, @v14;
+@v11 @v12 @v13 @v14
+6 PEARPEAR 6 PEARPEAR
+SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v15, @v16;
+@v15 @v16
+6 PEARPEAR
+SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
+'APPLE';
+SELECT @v17, @v18;
+@v17 @v18
+4 Bob
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
+'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
+SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
+'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
+SELECT @v19, @v20;
+@v19 @v20
+2 APPLE
+SELECT * FROM t2;
+fruit_id fruit_name
+2 APPLE
+2 APPLE
+DROP TABLE t1;
+DROP TABLE t2;
CREATE TABLE t1 (a CHAR(1));
INSERT INTO t1 VALUES('A'), (0);
SELECT a FROM t1 WHERE a=0;
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index 64d643505c5..db503f7aa6d 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -328,4 +328,81 @@ create event
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
on schedule every 2 year do select 1;
ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long
+create event event_35981 on schedule every 6 month on completion preserve
+disable
+do
+select 1;
+The following SELECTs should all give 1
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+on_completion = 'PRESERVE';
+count(*)
+1
+alter event event_35981 enable;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+on_completion = 'PRESERVE';
+count(*)
+1
+alter event event_35981 on completion not preserve;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+on_completion = 'NOT PRESERVE';
+count(*)
+1
+alter event event_35981 disable;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+on_completion = 'NOT PRESERVE';
+count(*)
+1
+alter event event_35981 on completion preserve;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+on_completion = 'PRESERVE';
+count(*)
+1
+drop event event_35981;
+create event event_35981 on schedule every 6 month disable
+do
+select 1;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+on_completion = 'NOT PRESERVE';
+count(*)
+1
+drop event event_35981;
+create event event_35981 on schedule every 1 hour starts current_timestamp
+on completion not preserve
+do
+select 1;
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00';
+ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
+drop event event_35981;
+create event event_35981 on schedule every 1 hour starts current_timestamp
+on completion not preserve
+do
+select 1;
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00' on completion preserve;
+Warnings:
+Note 1544 Event execution time is in the past. Event has been disabled
+drop event event_35981;
+create event event_35981 on schedule every 1 hour starts current_timestamp
+on completion preserve
+do
+select 1;
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00';
+Warnings:
+Note 1544 Event execution time is in the past. Event has been disabled
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00' on completion not preserve;
+ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00' on completion preserve;
+Warnings:
+Note 1544 Event execution time is in the past. Event has been disabled
+drop event event_35981;
drop database events_test;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 814cf42d16c..c698531dfec 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -59,7 +59,8 @@ begin
select get_lock('test_bug16407', 60);
end|
"Now if everything is fine the event has compiled and is locked"
-select /*1*/ user, host, db, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
+select /*1*/ user, host, db, info from information_schema.processlist
+where info = 'select get_lock(\'test_bug16407\', 60)';
user host db info
root localhost events_test select get_lock('test_bug16407', 60)
select release_lock('test_bug16407');
@@ -114,18 +115,18 @@ event_schema event_name sql_mode
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_4
-select /*2*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*2*/ user, host, db, info from information_schema.processlist
+where info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
-event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60)
select release_lock('ee_16407_2');
release_lock('ee_16407_2')
1
-select /*3*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*3*/ user, host, db, info from information_schema.processlist
+where info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
-event_scheduler localhost NULL NULL
set global event_scheduler= off;
select * from events_smode_test order by ev_name, a;
ev_name a
@@ -164,7 +165,9 @@ select release_lock('ee_16407_5');
call events_test.ee_16407_6_pendant();
end|
"Should have 2 locked processes"
-select /*4*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*4*/ user, host, db, info from information_schema.processlist
+where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
+order by info;
user host db info
event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_5', 60)
@@ -173,7 +176,9 @@ select release_lock('ee_16407_5');
release_lock('ee_16407_5')
1
"Should have 0 processes locked"
-select /*5*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*5*/ user, host, db, info from information_schema.processlist
+where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
+order by info;
user host db info
event_scheduler localhost NULL NULL
select * from events_smode_test order by ev_name, a;
@@ -566,10 +571,9 @@ SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON;
-CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
-ev_nm char(40), ev_cnt int,
-ev_tm timestamp) ENGINE=MyISAM;
-SET @ev_base_date = 20281224180000;
+CREATE TABLE events_test.event_log
+(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
+ENGINE=MyISAM;
SET autocommit=0;
CREATE USER evtest1@localhost;
SET PASSWORD FOR evtest1@localhost = password('ev1');
@@ -582,41 +586,40 @@ GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E3
GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
connection e1;
-USE events_test;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
SET AUTOCOMMIT = 0;
SET @evname = 'ev_sched_1823';
SET @cnt = 0;
-SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
IF @cnt < 6 THEN
-INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
COMMIT;
END IF;
-SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
IF @cnt < 6 THEN
-INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
ROLLBACK;
END IF;
END;|
+Sleep till the first INSERT into events_test.event_log occured
+SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
+Expect 1
+1
connection default;
-DROP EVENT ev_sched_1823;
DROP USER evtest1@localhost;
-USE test;
-=====================================================================================
-select id,ev_nm,ev_cnt from event_log order by id;
-id ev_nm ev_cnt
-1 ev_sched_1823 1
-2 ev_sched_1823 2
-3 ev_sched_1823 3
-4 ev_sched_1823 4
-5 ev_sched_1823 5
-6 ev_sched_1823 6
-DROP TABLE event_log;
+Sleep 4 seconds
+SELECT COUNT(*) INTO @row_cnt FROM events_test.event_log;
+Sleep 4 seconds
+SELECT COUNT(*) > @row_cnt AS "Expect 0" FROM events_test.event_log;
+Expect 0
+0
+DROP EVENT events_test.ev_sched_1823;
+DROP TABLE events_test.event_log;
SET GLOBAL event_scheduler = OFF;
SET GLOBAL event_scheduler= ON;
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
- DO BEGIN
+DO BEGIN
SELECT 1;
END;|
SET GLOBAL event_scheduler= OFF;
@@ -736,3 +739,4 @@ select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name
drop event e1;
DROP DATABASE events_test;
+SET GLOBAL event_scheduler = 'ON';
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 2ce8b8c384f..3de741b5efb 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -107,3 +107,78 @@ X X X X X X X X X
X X X X X X X X X Range checked for each record (index map: 0xFFFFFFFFFF)
DROP TABLE t2;
DROP TABLE t1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+EXPLAIN EXTENDED SELECT 1
+FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
+EXPLAIN EXTENDED SELECT 1
+FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
+prepare s1 from
+'EXPLAIN EXTENDED SELECT 1
+ FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1';
+execute s1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
+prepare s1 from
+'EXPLAIN EXTENDED SELECT 1
+ FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1';
+execute s1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
+execute s1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
+DROP TABLE t1,t2;
+#
+# Bug#37870: Usage of uninitialized value caused failed assertion.
+#
+create table t1 (dt datetime not null, t time not null);
+create table t2 (dt datetime not null);
+insert into t1 values ('2001-01-01 1:1:1', '1:1:1'),
+('2001-01-01 1:1:1', '1:1:1');
+insert into t2 values ('2001-01-01 1:1:1'), ('2001-01-01 1:1:1');
+flush tables;
+EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY OUTR ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY INNR ALL NULL NULL NULL NULL 2 Using where
+flush tables;
+SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
+dt
+flush tables;
+EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY OUTR ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY INNR ALL NULL NULL NULL NULL 2 Using where
+flush tables;
+SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
+dt
+2001-01-01 01:01:01
+2001-01-01 01:01:01
+drop tables t1, t2;
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index 7ebc34ac8bc..dbf7295270e 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -9,7 +9,9 @@ DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT= 0;
+SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
DROP TABLE IF EXISTS federated.t1;
Warnings:
@@ -186,6 +188,7 @@ INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010);
SELECT * FROM federated.t1;
id name other created
1 First Name 11111 2004-04-04 04:04:04
+10 Tenth Name 101010 2004-04-04 04:04:04
2 Second Name 22222 2004-04-04 04:04:04
3 Third Name 33333 2004-04-04 04:04:04
4 Fourth Name 44444 2004-04-04 04:04:04
@@ -194,7 +197,6 @@ id name other created
7 Seventh Name 77777 2004-04-04 04:04:04
8 Eigth Name 88888 2004-04-04 04:04:04
9 Ninth Name 99999 2004-04-04 04:04:04
-10 Tenth Name 101010 2004-04-04 04:04:04
SELECT * FROM federated.t1 WHERE id = 5;
id name other created
5 Fifth Name 55555 2004-04-04 04:04:04
@@ -208,6 +210,7 @@ SELECT * FROM federated.t1 WHERE name = 'Sixth Name' AND other = 44444;
id name other created
SELECT * FROM federated.t1 WHERE name like '%th%';
id name other created
+10 Tenth Name 101010 2004-04-04 04:04:04
3 Third Name 33333 2004-04-04 04:04:04
4 Fourth Name 44444 2004-04-04 04:04:04
5 Fifth Name 55555 2004-04-04 04:04:04
@@ -215,7 +218,6 @@ id name other created
7 Seventh Name 77777 2004-04-04 04:04:04
8 Eigth Name 88888 2004-04-04 04:04:04
9 Ninth Name 99999 2004-04-04 04:04:04
-10 Tenth Name 101010 2004-04-04 04:04:04
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
SELECT * FROM federated.t1 WHERE name = '3rd name';
id name other created
@@ -336,6 +338,7 @@ VALUES ('Tenth Name', 101010, '2005-03-12 12:00:01');
SELECT * FROM federated.t1;
id name other created
1 First Name 11111 2004-01-01 01:01:01
+10 Tenth Name 101010 2005-03-12 12:00:01
2 Second Name 22222 2004-01-23 02:43:00
3 Third Name 33333 2004-02-14 02:14:00
4 Fourth Name 44444 2003-04-05 00:00:00
@@ -344,7 +347,6 @@ id name other created
7 Seventh Name 77777 2003-12-12 18:32:00
8 Eigth Name 88888 2005-03-12 11:00:00
9 Ninth Name 99999 2005-03-12 11:00:01
-10 Tenth Name 101010 2005-03-12 12:00:01
SELECT * FROM federated.t1 WHERE id = 5;
id name other created
5 Fifth Name 55555 2001-02-02 02:02:02
@@ -356,6 +358,7 @@ id name other created
4 Fourth Name 44444 2003-04-05 00:00:00
SELECT * FROM federated.t1 WHERE name like '%th%';
id name other created
+10 Tenth Name 101010 2005-03-12 12:00:01
3 Third Name 33333 2004-02-14 02:14:00
4 Fourth Name 44444 2003-04-05 00:00:00
5 Fifth Name 55555 2001-02-02 02:02:02
@@ -363,7 +366,6 @@ id name other created
7 Seventh Name 77777 2003-12-12 18:32:00
8 Eigth Name 88888 2005-03-12 11:00:00
9 Ninth Name 99999 2005-03-12 11:00:01
-10 Tenth Name 101010 2005-03-12 12:00:01
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
SELECT * FROM federated.t1 WHERE name = '3rd name';
id name other created
@@ -470,17 +472,17 @@ id name other
7 Seventh Name NULL
SELECT * FROM federated.t1 WHERE name IS NULL;
id name other
-4 NULL NULL
10 NULL fee fie foe fum
+4 NULL NULL
SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL;
id name other
4 NULL NULL
SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL;
id name other
+10 NULL fee fie foe fum
2 Second Name NULL
4 NULL NULL
7 Seventh Name NULL
-10 NULL fee fie foe fum
UPDATE federated.t1
SET name = 'Fourth Name', other = 'four four four'
WHERE name IS NULL AND other IS NULL;
@@ -492,6 +494,7 @@ id name other
SELECT * FROM federated.t1;
id name other
1 First Name 11111
+10 Tenth Name fee fie foe fum
2 Second Name two two two two
3 Third Name 33333
4 Fourth Name four four four
@@ -500,7 +503,6 @@ id name other
7 Seventh Name seven seven
8 Eigth Name 88888
9 Ninth Name 99999
-10 Tenth Name fee fie foe fum
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -681,8 +683,8 @@ id col1 col2 col3 col4
SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'five 5 five five 5')
OR (col2 = 'three Three' AND col3 = 33);
id col1 col2 col3 col4
-5 5 five 5 five five 5 5 55555
3 3 three Three 33 33333
+5 5 five 5 five five 5 5 55555
SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'Two two')
OR (col2 = 444 AND col3 = 4444444);
id col1 col2 col3 col4
@@ -693,25 +695,25 @@ OR col3 = 33
OR col4 = 4444444;
id col1 col2 col3 col4
1 1 one One 11 1111
+10 10 Tenth ten TEN 1010101 1010
2 2 Two two 22 2222
3 3 three Three 33 33333
4 4 fourfourfour 444 4444444
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE id > 5;
id col1 col2 col3 col4
+10 10 Tenth ten TEN 1010101 1010
6 6 six six Sixsix 6666 6
7 7 seven Sevenseven 77777 7777
8 8 eight eight eight 88888 88
9 9 nine Nine 999999 999999
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE id >= 5;
id col1 col2 col3 col4
+10 10 Tenth ten TEN 1010101 1010
5 5 five 5 five five 5 5 55555
6 6 six six Sixsix 6666 6
7 7 seven Sevenseven 77777 7777
8 8 eight eight eight 88888 88
9 9 nine Nine 999999 999999
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE id < 5;
id col1 col2 col3 col4
1 1 one One 11 1111
@@ -728,6 +730,7 @@ id col1 col2 col3 col4
SELECT * FROM federated.t1 WHERE id != 5;
id col1 col2 col3 col4
1 1 one One 11 1111
+10 10 Tenth ten TEN 1010101 1010
2 2 Two two 22 2222
3 3 three Three 33 33333
4 4 fourfourfour 444 4444444
@@ -735,7 +738,6 @@ id col1 col2 col3 col4
7 7 seven Sevenseven 77777 7777
8 8 eight eight eight 88888 88
9 9 nine Nine 999999 999999
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE id > 3 AND id < 7;
id col1 col2 col3 col4
4 4 fourfourfour 444 4444444
@@ -763,25 +765,25 @@ id col1 col2 col3 col4
SELECT * FROM federated.t1 WHERE id < 3 OR id > 7;
id col1 col2 col3 col4
1 1 one One 11 1111
+10 10 Tenth ten TEN 1010101 1010
2 2 Two two 22 2222
8 8 eight eight eight 88888 88
9 9 nine Nine 999999 999999
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE col2 = 'three Three';
id col1 col2 col3 col4
3 3 three Three 33 33333
SELECT * FROM federated.t1 WHERE col2 > 'one';
id col1 col2 col3 col4
1 1 one One 11 1111
+10 10 Tenth ten TEN 1010101 1010
2 2 Two two 22 2222
3 3 three Three 33 33333
6 6 six six Sixsix 6666 6
7 7 seven Sevenseven 77777 7777
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE col2 LIKE 's%';
id col1 col2 col3 col4
-7 7 seven Sevenseven 77777 7777
6 6 six six Sixsix 6666 6
+7 7 seven Sevenseven 77777 7777
SELECT * FROM federated.t1 WHERE col2 LIKE 'si%';
id col1 col2 col3 col4
6 6 six six Sixsix 6666 6
@@ -791,6 +793,7 @@ id col1 col2 col3 col4
SELECT * FROM federated.t1 WHERE col2 NOT LIKE 'e%';
id col1 col2 col3 col4
1 1 one One 11 1111
+10 10 Tenth ten TEN 1010101 1010
2 2 Two two 22 2222
3 3 three Three 33 33333
4 4 fourfourfour 444 4444444
@@ -798,18 +801,17 @@ id col1 col2 col3 col4
6 6 six six Sixsix 6666 6
7 7 seven Sevenseven 77777 7777
9 9 nine Nine 999999 999999
-10 10 Tenth ten TEN 1010101 1010
SELECT * FROM federated.t1 WHERE col2 <> 'one One';
id col1 col2 col3 col4
-4 4 fourfourfour 444 4444444
-5 5 five 5 five five 5 5 55555
-8 8 eight eight eight 88888 88
-9 9 nine Nine 999999 999999
+10 10 Tenth ten TEN 1010101 1010
2 2 Two two 22 2222
3 3 three Three 33 33333
+4 4 fourfourfour 444 4444444
+5 5 five 5 five five 5 5 55555
6 6 six six Sixsix 6666 6
7 7 seven Sevenseven 77777 7777
-10 10 Tenth ten TEN 1010101 1010
+8 8 eight eight eight 88888 88
+9 9 nine Nine 999999 999999
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`col1` varchar(8) NOT NULL DEFAULT '',
@@ -976,11 +978,11 @@ INSERT INTO federated.t1 (name, floatval, other)
VALUES (0, 00.3333, NULL);
SELECT * FROM federated.t1;
id name floatval other
+1 NULL NULL NULL
+NULL 0 0.3333 NULL
NULL NULL NULL NULL
NULL NULL NULL NULL
-1 NULL NULL NULL
NULL foo 33.3333 NULL
-NULL 0 0.3333 NULL
SELECT count(*) FROM federated.t1
WHERE id IS NULL
AND name IS NULL
@@ -2132,6 +2134,8 @@ End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
End of 5.1 tests
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/r/federated_bug_25714.result b/mysql-test/r/federated_bug_25714.result
index cad487ec791..5730eedc246 100644
--- a/mysql-test/r/federated_bug_25714.result
+++ b/mysql-test/r/federated_bug_25714.result
@@ -9,7 +9,9 @@ DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
-SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT= 0;
+SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
DROP TABLE IF EXISTS federated.bug_13118_table;
CREATE TABLE federated.t1 (
@@ -51,9 +53,10 @@ id value
7 54
8 55
DROP TABLE federated.t1;
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
DROP TABLE federated.t1;
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
-SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index c198176532f..fd9cf69907c 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1416,4 +1416,41 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
AVG(a) CAST(AVG(a) AS DECIMAL)
15 15
DROP TABLE t1;
+CREATE TABLE derived1 (a bigint(21));
+INSERT INTO derived1 VALUES (2);
+CREATE TABLE D (
+pk int(11) NOT NULL AUTO_INCREMENT,
+int_nokey int(11) DEFAULT NULL,
+int_key int(11) DEFAULT NULL,
+filler blob,
+PRIMARY KEY (pk),
+KEY int_key (int_key)
+);
+INSERT INTO D VALUES
+(39,40,4,repeat(' X', 42)),
+(43,56,4,repeat(' X', 42)),
+(47,12,4,repeat(' X', 42)),
+(71,28,4,repeat(' X', 42)),
+(76,54,4,repeat(' X', 42)),
+(83,45,4,repeat(' X', 42)),
+(105,53,12,NULL);
+SELECT
+(SELECT COUNT( int_nokey )
+FROM derived1 AS X
+WHERE
+X.int_nokey < 61
+GROUP BY pk
+LIMIT 1)
+FROM D AS X
+WHERE X.int_key < 13
+GROUP BY int_nokey LIMIT 1;
+(SELECT COUNT( int_nokey )
+FROM derived1 AS X
+WHERE
+X.int_nokey < 61
+GROUP BY pk
+LIMIT 1)
+1
+DROP TABLE derived1;
+DROP TABLE D;
End of 5.0 tests
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 30c4d1e4ca1..12e1460e128 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1274,6 +1274,36 @@ tt
41
SET sql_mode=@save_sql_mode;
DROP TABLE t1, t2;
+#
+# BUG#38072: Wrong result: HAVING not observed in a query with aggregate
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+int_nokey int(11) NOT NULL,
+int_key int(11) NOT NULL,
+varchar_key varchar(1) NOT NULL,
+varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY int_key (int_key),
+KEY varchar_key (varchar_key)
+);
+INSERT INTO t1 VALUES
+(1,5,5, 'h','h'),
+(2,1,1, '{','{'),
+(3,1,1, 'z','z'),
+(4,8,8, 'x','x'),
+(5,7,7, 'o','o'),
+(6,3,3, 'p','p'),
+(7,9,9, 'c','c'),
+(8,0,0, 'k','k'),
+(9,6,6, 't','t'),
+(10,0,0,'c','c');
+explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+X
+drop table t1;
End of 5.0 tests
CREATE TABLE t1 (a INT, b INT,
PRIMARY KEY (a),
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 1827871861e..45d335bba9e 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -520,6 +520,16 @@ a filler b
4 zz 4
5 qq 4
drop table t1, t2;
+CREATE TABLE t1 (a varchar(8), b set('a','b','c','d','e','f','g','h'),
+KEY b(b), KEY a(a));
+INSERT INTO t1 VALUES ('y',''), ('z','');
+SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
+(a='pure-S') OR (a='DE80337a') OR (a='DE80799');
+b a
+ y
+ z
+DROP TABLE t1;
+End of 5.0 tests
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t0,t1,t2;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index c5c79b15ca6..7da540dd8f6 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -758,7 +758,6 @@ table_schema table_name column_name
information_schema COLUMNS COLUMN_DEFAULT
information_schema COLUMNS COLUMN_TYPE
information_schema EVENTS EVENT_DEFINITION
-information_schema EVENTS SQL_MODE
information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
@@ -768,8 +767,6 @@ information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
-information_schema TRIGGERS SQL_MODE
-information_schema TRIGGERS DEFINER
information_schema VIEWS VIEW_DEFINITION
select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime';
@@ -1646,4 +1643,13 @@ drop table t1;
drop function f1;
select * from information_schema.tables where 1=sleep(100000);
select * from information_schema.columns where 1=sleep(100000);
+explain select count(*) from information_schema.tables;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
+explain select count(*) from information_schema.columns;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE columns ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
+explain select count(*) from information_schema.views;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE views ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
End of 5.1 tests.
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index eff5f117c50..83b8217b570 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -221,3 +221,24 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
drop database testdb_1;
drop user testdb_1@localhost;
drop user testdb_2@localhost;
+create database testdb_1;
+create table testdb_1.t1 (a int);
+create view testdb_1.v1 as select * from testdb_1.t1;
+grant show view on testdb_1.* to mysqltest_1@localhost;
+grant select on testdb_1.v1 to mysqltest_1@localhost;
+select table_schema, table_name, view_definition from information_schema.views
+where table_name='v1';
+table_schema table_name view_definition
+testdb_1 v1 select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1`
+show create view testdb_1.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v1` AS select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1` latin1 latin1_swedish_ci
+revoke select on testdb_1.v1 from mysqltest_1@localhost;
+select table_schema, table_name, view_definition from information_schema.views
+where table_name='v1';
+table_schema table_name view_definition
+testdb_1 v1
+show create view testdb_1.v1;
+ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1'
+drop user mysqltest_1@localhost;
+drop database testdb_1;
diff --git a/mysql-test/r/information_schema_part.result b/mysql-test/r/information_schema_part.result
index 8455c8e014e..74d52e9521f 100644
--- a/mysql-test/r/information_schema_part.result
+++ b/mysql-test/r/information_schema_part.result
@@ -119,7 +119,10 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY LINEAR HASH (a)
+(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD
@@ -134,7 +137,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) */
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1";
PARTITION_DESCRIPTION
diff --git a/mysql-test/r/innodb-semi-consistent.result b/mysql-test/r/innodb-semi-consistent.result
index f1139390f20..6173048c320 100644
--- a/mysql-test/r/innodb-semi-consistent.result
+++ b/mysql-test/r/innodb-semi-consistent.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+set binlog_format=mixed;
set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
@@ -6,6 +7,7 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode;
a
3
+set binlog_format=mixed;
set session transaction isolation level read committed;
set autocommit=0;
update t1 set a=10 where a=5;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 731a833dc42..d4e3243733a 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1024,6 +1024,7 @@ id code name
4 2 Erik
5 3 Sasha
COMMIT;
+SET binlog_format='MIXED';
BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
@@ -2961,9 +2962,11 @@ drop table t1,t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select * from t1 where a = 7 and b = 3 for update;
@@ -3002,6 +3005,7 @@ d e
3 1
8 6
12 1
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2;
@@ -3032,30 +3036,39 @@ a b
3 1
8 6
12 1
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
insert into t1 select * from t2;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
update t3 set b = (select b from t2 where a = d);
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t5 (select * from t2 lock in share mode);
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t6 set e = (select b from t2 where a = d lock in share mode);
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t8 (select * from t2 for update);
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t9 set e = (select b from t2 where a = d for update);
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
@@ -3202,6 +3215,7 @@ id
-10
1
DROP TABLE t1;
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
DROP TABLE IF EXISTS t1, t2;
@@ -3212,6 +3226,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1;
SELECT * FROM t2;
a
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1);
@@ -3219,10 +3234,12 @@ COMMIT;
SELECT * FROM t1 WHERE a=1;
a
1
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
SELECT * FROM t2;
a
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2);
diff --git a/mysql-test/r/innodb_data_home_dir_basic.result b/mysql-test/r/innodb_data_home_dir_basic.result
index fb9a0b0bca5..e4bdd79b7c3 100644
--- a/mysql-test/r/innodb_data_home_dir_basic.result
+++ b/mysql-test/r/innodb_data_home_dir_basic.result
@@ -1,7 +1,7 @@
'#---------------------BS_STVARS_025_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir)
-0
+1
1 Expected
'#---------------------BS_STVARS_025_02----------------------#'
SET @@GLOBAL.innodb_data_home_dir=1;
@@ -9,7 +9,7 @@ ERROR HY000: Variable 'innodb_data_home_dir' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir)
-0
+1
1 Expected
'#---------------------BS_STVARS_025_03----------------------#'
SELECT @@GLOBAL.innodb_data_home_dir = VARIABLE_VALUE
@@ -20,7 +20,7 @@ NULL
1 Expected
SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir)
-0
+1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_025_05----------------------#'
SELECT COUNT(@@innodb_data_home_dir);
COUNT(@@innodb_data_home_dir)
-0
+1
1 Expected
SELECT COUNT(@@local.innodb_data_home_dir);
ERROR HY000: Variable 'innodb_data_home_dir' is a GLOBAL variable
@@ -46,7 +46,7 @@ ERROR HY000: Variable 'innodb_data_home_dir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir)
-0
+1
1 Expected
SELECT innodb_data_home_dir = @@SESSION.innodb_data_home_dir;
ERROR 42S22: Unknown column 'innodb_data_home_dir' in 'field list'
diff --git a/mysql-test/r/innodb_flush_method_basic.result b/mysql-test/r/innodb_flush_method_basic.result
index 836328c5c9b..8c8924cdd86 100644
--- a/mysql-test/r/innodb_flush_method_basic.result
+++ b/mysql-test/r/innodb_flush_method_basic.result
@@ -1,7 +1,7 @@
'#---------------------BS_STVARS_029_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
+1
1 Expected
'#---------------------BS_STVARS_029_02----------------------#'
SET @@GLOBAL.innodb_flush_method=1;
@@ -9,7 +9,7 @@ ERROR HY000: Variable 'innodb_flush_method' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
+1
1 Expected
'#---------------------BS_STVARS_029_03----------------------#'
SELECT @@GLOBAL.innodb_flush_method = VARIABLE_VALUE
@@ -20,7 +20,7 @@ NULL
1 Expected
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
+1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_029_05----------------------#'
SELECT COUNT(@@innodb_flush_method);
COUNT(@@innodb_flush_method)
-0
+1
1 Expected
SELECT COUNT(@@local.innodb_flush_method);
ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable
@@ -46,7 +46,7 @@ ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method)
-0
+1
1 Expected
SELECT innodb_flush_method = @@SESSION.innodb_flush_method;
ERROR 42S22: Unknown column 'innodb_flush_method' in 'field list'
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 0b33e51ea35..2c14b1f2385 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1512,6 +1512,7 @@ ok
drop table t1;
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+set binlog_format=mixed;
# Switch to connection con1
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
ENGINE = InnoDB;
@@ -1667,3 +1668,12 @@ explain select a from t2 where a=b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 10 NULL # Using where; Using index
drop table t1, t2;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
+@@session.sql_log_bin 1
+@@session.binlog_format STATEMENT
+@@session.tx_isolation READ-COMMITTED
+CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+DROP TABLE t1;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index f01ab2bfb8d..736ecf1d90e 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -747,11 +747,13 @@ select t1.b from v1a;
ERROR 42S22: Unknown column 't1.b' in 'field list'
select * from v1a join v1b on t1.b = t2.b;
ERROR 42S22: Unknown column 't1.b' in 'on clause'
-select * from information_schema.statistics join information_schema.columns
-using(table_name,column_name) where table_name='user';
-TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-user Host NULL mysql 0 mysql PRIMARY 1 A # NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
-user User NULL mysql 0 mysql PRIMARY 2 A # NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
+select
+statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.COLLATION, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.COMMENT,
+columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
+from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user';
+TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA COLUMN_COMMENT
+user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL BTREE NULL mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+user User NULL mysql 0 mysql PRIMARY 2 A NULL NULL BTREE NULL mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
drop table t1;
drop table t2;
drop table t3;
diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result
index 2acf74162a4..caed588acdb 100644
--- a/mysql-test/r/limit.result
+++ b/mysql-test/r/limit.result
@@ -111,3 +111,6 @@ set @a=-14632475938453979136;
execute s using @a, @a;
ERROR HY000: Incorrect arguments to EXECUTE
End of 5.0 tests
+select 1 as a limit 4294967296,10;
+a
+End of 5.1 tests
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 3a23d9de6b3..4e458e831cf 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -337,6 +337,126 @@ DROP VIEW v2;
DROP VIEW v3;
# -- End of Bug#35469.
+Bug#37114
+SET SESSION character_set_client=latin1;
+SET SESSION character_set_server=latin1;
+SET SESSION character_set_connection=latin1;
+SET @OLD_SQL_MODE=@@SESSION.SQL_MODE;
+test LOAD DATA INFILE
+SET sql_mode = '';
+SELECT '1 \\aa\n' INTO DUMPFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt';
+CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM;
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ' ';
+SELECT * FROM t1;
+id val1
+1 \aa
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114_out.txt' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1;
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114_out.txt' FIELDS TERMINATED BY ' ' FROM t1;
+INSERT INTO t1 (id, val1) VALUES (1, '\aa');
+SELECT * FROM t1;
+id val1
+1 \aa
+1 \aa
+SET sql_mode='';
+INSERT INTO t1 (id, val1) VALUES (1, '\aa');
+SELECT * FROM t1;
+id val1
+1 \aa
+1 \aa
+1 aa
+DROP TABLE t1;
+test SELECT INTO OUTFILE
+CREATE TABLE t1 (id INT PRIMARY KEY, val1 CHAR(4));
+CREATE TABLE t2 LIKE t1;
+SET sql_mode = '';
+INSERT INTO t1 (id, val1) VALUES (5, '\ttab');
+INSERT INTO t1 (id, val1) VALUES (4, '\\r');
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+INSERT INTO t1 (id, val1) VALUES (3, '\tx');
+1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS TERMINATED BY ' ';
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+t id val1 hex(val1)
+before 3 \tx 5C7478
+after 3 \tx 5C7478
+before 4 \r 5C72
+after 4 \r 5C72
+before 5 tab 09746162
+after 5 tab 09746162
+TRUNCATE t2;
+SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
+LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
+3 \tx
+4 \r
+5 tab
+
+1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' ';
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+t id val1 hex(val1)
+before 3 \tx 5C7478
+after 3 \tx 5C7478
+before 4 \r 5C72
+after 4 \r 5C72
+before 5 tab 09746162
+after 5 tab 09746162
+TRUNCATE t2;
+SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
+LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
+3 \\tx
+4 \\r
+5 tab
+
+SET sql_mode = '';
+2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS TERMINATED BY ' ';
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+t id val1 hex(val1)
+before 3 \tx 5C7478
+after 3 \tx 5C7478
+before 4 \r 5C72
+after 4 \r 5C72
+before 5 tab 09746162
+after 5 tab 09746162
+TRUNCATE t2;
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
+LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
+3 \\tx
+4 \\r
+5 tab
+
+SET sql_mode = '';
+2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' ';
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+t id val1 hex(val1)
+before 3 \tx 5C7478
+after 3 \tx 5C7478
+before 4 \r 5C72
+after 4 \r 5C72
+before 5 tab 09746162
+after 5 tab 09746162
+TRUNCATE t2;
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
+LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
+3 \tx
+4 \r
+5 tab
+
+set session sql_mode=@OLD_SQL_MODE;
+DROP TABLE t1,t2;
+End of 5.0 tests
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
@@ -364,3 +484,4 @@ SET character_set_filesystem=default;
select @@character_set_filesystem;
@@character_set_filesystem
binary
+End of 5.1 tests
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index cd05fc1473f..a0e3d9fad06 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -96,6 +96,40 @@ alter table t1 auto_increment=0;
alter table t1 auto_increment=0;
unlock tables;
drop table t1;
+CREATE TABLE t1 (
+a int(11) unsigned default NULL,
+b varchar(255) default NULL,
+UNIQUE KEY a (a),
+KEY b (b)
+);
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
+CREATE TABLE t2 SELECT * FROM t1;
+CREATE TABLE t3 SELECT * FROM t1;
+# test altering of columns that multiupdate doesn't use
+# normal mode
+# PS mode
+# test altering of columns that multiupdate uses
+# normal mode
+# PS mode
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1( a INT, b INT );
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
+# 1. test regular tables
+# 1.1. test altering of columns that multiupdate doesn't use
+# 1.1.1. normal mode
+# 1.1.2. PS mode
+# 1.2. test altering of columns that multiupdate uses
+# 1.2.1. normal mode
+# 1.2.2. PS mode
+ALTER TABLE t1 ADD COLUMN a INT;
+# 2. test UNIONs
+# 2.1. test altering of columns that multiupdate doesn't use
+# 2.1.1. normal mode
+# 2.1.2. PS mode
+# 2.2. test altering of columns that multiupdate uses
+# 2.2.1. normal mode
+# 2.2.2. PS mode
+DROP TABLE t1;
End of 5.0 tests
create table t1 (i int);
lock table t1 read;
diff --git a/mysql-test/r/log_basic.result b/mysql-test/r/log_basic.result
index 44d0ff48f1d..edda72fa91e 100644
--- a/mysql-test/r/log_basic.result
+++ b/mysql-test/r/log_basic.result
@@ -5,8 +5,8 @@ INIT_VALUE
SELECT @@log AS INIT_VALUE;
INIT_VALUE
1
-SET @@global.log = ON;
-SET global log = 0;
+SET @@global.general_log = ON;
+SET global general_log = 0;
'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
'#--------------------FN_DYNVARS_062_02-------------------------#'
diff --git a/mysql-test/r/log_bin_trust_routine_creators_basic.result b/mysql-test/r/log_bin_trust_routine_creators_basic.result
index 2b7fb548f36..cfcbcddfca3 100644
--- a/mysql-test/r/log_bin_trust_routine_creators_basic.result
+++ b/mysql-test/r/log_bin_trust_routine_creators_basic.result
@@ -5,17 +5,17 @@ SELECT @start_global_value;
'#--------------------FN_DYNVARS_064_01-------------------------#'
SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SET @@global.log_bin_trust_routine_creators = DEFAULT;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
0
'#--------------------FN_DYNVARS_064_02-------------------------#'
SET @@global.log_bin_trust_routine_creators = DEFAULT;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators = 'FALSE';
@@global.log_bin_trust_routine_creators = 'FALSE'
1
@@ -24,37 +24,37 @@ Warning 1292 Truncated incorrect DOUBLE value: 'FALSE'
'#--------------------FN_DYNVARS_064_03-------------------------#'
SET @@global.log_bin_trust_routine_creators = ON;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
1
SET @@global.log_bin_trust_routine_creators = OFF;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
0
SET @@global.log_bin_trust_routine_creators = 0;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
0
SET @@global.log_bin_trust_routine_creators = 1;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
1
SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
1
SET @@global.log_bin_trust_routine_creators = FALSE;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
0
@@ -70,7 +70,7 @@ SET @@global.log_bin_trust_routine_creators = "OFFF";
ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'OFFF'
SET @@global.log_bin_trust_routine_creators = OF;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
0
@@ -96,14 +96,14 @@ ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable
'#---------------------FN_DYNVARS_064_07----------------------#'
SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators;
@@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators
1
'#---------------------FN_DYNVARS_064_08----------------------#'
SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@log_bin_trust_routine_creators;
@@log_bin_trust_routine_creators
1
@@ -115,7 +115,7 @@ SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators
ERROR 42S22: Unknown column 'log_bin_trust_routine_creators' in 'field list'
SET @@global.log_bin_trust_routine_creators = @start_global_value;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators
1
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index c293956148f..63903a034d2 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -187,6 +187,8 @@ SELECT @@general_log, @@log;
@@general_log @@log
1 1
SET GLOBAL log = 0;
+Warnings:
+Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log OFF
@@ -216,6 +218,8 @@ SELECT @@slow_query_log, @@log_slow_queries;
@@slow_query_log @@log_slow_queries
0 0
SET GLOBAL log_slow_queries = 0;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
SHOW VARIABLES LIKE 'slow_query_log';
Variable_name Value
slow_query_log OFF
@@ -270,4 +274,28 @@ SET GLOBAL general_log_file = @general_log_file_saved;
SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
# -- End of Bug#32748.
+deprecated:
+SET GLOBAL log = 0;
+Warnings:
+Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
+SET GLOBAL log_slow_queries = 0;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SET GLOBAL log = DEFAULT;
+Warnings:
+Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
+SET GLOBAL log_slow_queries = DEFAULT;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+not deprecated:
+SELECT @@global.general_log_file INTO @my_glf;
+SELECT @@global.slow_query_log_file INTO @my_sqlf;
+SET GLOBAL general_log = 0;
+SET GLOBAL slow_query_log = 0;
+SET GLOBAL general_log_file = 'WL4403_G.log';
+SET GLOBAL slow_query_log_file = 'WL4403_SQ.log';
+SET GLOBAL general_log_file = @my_glf;
+SET GLOBAL slow_query_log_file = @my_sqlf;
+SET GLOBAL general_log = DEFAULT;
+SET GLOBAL slow_query_log = DEFAULT;
End of 5.1 tests
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index 2a4cee9fbbc..2f294314b04 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -1,4 +1,11 @@
use mysql;
+SET @saved_long_query_time = @@long_query_time;
+SET @saved_log_output = @@log_output;
+SET @saved_general_log = @@GLOBAL.general_log;
+SET @saved_slow_query_log = @@GLOBAL.slow_query_log;
+SELECT @saved_long_query_time, @saved_log_output, @saved_general_log, @saved_slow_query_log;
+@saved_long_query_time @saved_log_output @saved_general_log @saved_slow_query_log
+10 FILE,TABLE 1 1
truncate table general_log;
select * from general_log;
event_time user_host thread_id server_id command_type argument
@@ -136,6 +143,7 @@ sleep(2)
select * from mysql.slow_log;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 mysql 0 0 1 select sleep(2)
+set @@session.long_query_time = @saved_long_query_time;
alter table mysql.general_log engine=myisam;
ERROR HY000: You cannot 'ALTER' a log table if logging is enabled
alter table mysql.slow_log engine=myisam;
@@ -213,6 +221,7 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query truncate table mysql.slow_log
TIMESTAMP USER_HOST THREAD_ID 1 Query set session long_query_time=1
TIMESTAMP USER_HOST THREAD_ID 1 Query select sleep(2)
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.slow_log
+TIMESTAMP USER_HOST THREAD_ID 1 Query set @@session.long_query_time = @saved_long_query_time
TIMESTAMP USER_HOST THREAD_ID 1 Query alter table mysql.general_log engine=myisam
TIMESTAMP USER_HOST THREAD_ID 1 Query alter table mysql.slow_log engine=myisam
TIMESTAMP USER_HOST THREAD_ID 1 Query drop table mysql.general_log
@@ -281,6 +290,7 @@ use mysql;
lock tables general_log read local, help_category read local;
ERROR HY000: You can't use locks with log tables.
unlock tables;
+SET SESSION long_query_time = 1000;
drop table if exists mysql.renamed_general_log;
drop table if exists mysql.renamed_slow_log;
drop table if exists mysql.general_log_new;
@@ -330,6 +340,7 @@ set global slow_query_log='ON';
ERROR 42S02: Table 'mysql.slow_log' doesn't exist
RENAME TABLE general_log2 TO general_log;
RENAME TABLE slow_log2 TO slow_log;
+SET SESSION long_query_time = @saved_long_query_time;
set global general_log='ON';
set global slow_query_log='ON';
flush logs;
@@ -390,7 +401,6 @@ SET GLOBAL general_log = 0;
FLUSH LOGS;
ALTER TABLE mysql.general_log DROP COLUMN seq;
ALTER TABLE mysql.general_log ENGINE = CSV;
-SET @old_long_query_time:=@@long_query_time;
SET GLOBAL slow_query_log = 0;
FLUSH LOGS;
TRUNCATE TABLE mysql.slow_log;
@@ -418,10 +428,11 @@ START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow quer
START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3
START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4
SET GLOBAL slow_query_log = 0;
-SET SESSION long_query_time =@old_long_query_time;
+SET SESSION long_query_time =@saved_long_query_time;
FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
drop procedure if exists proc25422_truncate_slow;
drop procedure if exists proc25422_truncate_general;
drop procedure if exists proc25422_alter_slow;
@@ -593,8 +604,6 @@ UNTIL done END REPEAT;
CLOSE cur1;
TRUNCATE mysql.general_log;
END //
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
select "put something into general_log";
@@ -614,11 +623,10 @@ DROP TABLE `db_17876.general_log_data`;
DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
+SET GLOBAL general_log = @saved_general_log;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
select CONNECTION_ID() into @thread_id;
truncate table mysql.general_log;
-set @old_general_log_state = @@global.general_log;
set global general_log = on;
set @lparam = "000 001 002 003 004 005 006 007 008 009"
"010 011 012 013 014 015 016 017 018 019"
@@ -725,6 +733,7 @@ execute long_query using @lparam;
set global general_log = off;
select command_type, argument from mysql.general_log where thread_id = @thread_id;
command_type argument
+Query set global general_log = on
Query set @lparam = "000 001 002 003 004 005 006 007 008 009"
"010 011 012 013 014 015 016 017 018 019"
"020 021 022 023 024 025 026 027 028 029"
@@ -831,8 +840,34 @@ Query execute long_query using @lparam
Execute select '000 001 002 003 004 005 006 007 008 009010 011 012 013 014 015 016 017 018 019020 021 022 023 024 025 026 027 028 029030 031 032 033 034 035 036 037 038 039040 041 042 043 044 045 046 047 048 049050 051 052 053 054 055 056 057 058 059060 061 062 063 064 065 066 067 068 069070 071 072 073 074 075 076 077 078 079080 081 082 083 084 085 086 087 088 089090 091 092 093 094 095 096 097 098 099100 101 102 103 104 105 106 107 108 109110 111 112 113 114 115 116 117 118 119120 121 122 123 124 125 126 127 128 129130 131 132 133 134 135 136 137 138 139140 141 142 143 144 145 146 147 148 149150 151 152 153 154 155 156 157 158 159160 161 162 163 164 165 166 167 168 169170 171 172 173 174 175 176 177 178 179180 181 182 183 184 185 186 187 188 189190 191 192 193 194 195 196 197 198 199200 201 202 203 204 205 206 207 208 209210 211 212 213 214 215 216 217 218 219220 221 222 223 224 225 226 227 228 229230 231 232 233 234 235 236 237 238 239240 241 242 243 244 245 246 247 248 249250 251 252 253 254 255 256 257 258 259260 261 262 263 264 265 266 267 268 269270 271 272 273 274 275 276 277 278 279280 281 282 283 284 285 286 287 288 289290 291 292 293 294 295 296 297 298 299300 301 302 303 304 305 306 307 308 309310 311 312 313 314 315 316 317 318 319320 321 322 323 324 325 326 327 328 329330 331 332 333 334 335 336 337 338 339340 341 342 343 344 345 346 347 348 349350 351 352 353 354 355 356 357 358 359360 361 362 363 364 365 366 367 368 369370 371 372 373 374 375 376 377 378 379380 381 382 383 384 385 386 387 388 389390 391 392 393 394 395 396 397 398 399400 401 402 403 404 405 406 407 408 409410 411 412 413 414 415 416 417 418 419420 421 422 423 424 425 426 427 428 429430 431 432 433 434 435 436 437 438 439440 441 442 443 444 445 446 447 448 449450 451 452 453 454 455 456 457 458 459460 461 462 463 464 465 466 467 468 469470 471 472 473 474 475 476 477 478 479480 481 482 483 484 485 486 487 488 489490 491 492 493 494 495 496 497 498 499500 501 502 503 504 505 506 507 508 509510 511 512 513 514 515 516 517 518 519520 521 522 523 524 525 526 527 528 529530 531 532 533 534 535 536 537 538 539540 541 542 543 544 545 546 547 548 549550 551 552 553 554 555 556 557 558 559560 561 562 563 564 565 566 567 568 569570 571 572 573 574 575 576 577 578 579580 581 582 583 584 585 586 587 588 589590 591 592 593 594 595 596 597 598 599600 601 602 603 604 605 606 607 608 609610 611 612 613 614 615 616 617 618 619620 621 622 623 624 625 626 627 628 629630 631 632 633 634 635 636 637 638 639640 641 642 643 644 645 646 647 648 649650 651 652 653 654 655 656 657 658 659660 661 662 663 664 665 666 667 668 669670 671 672 673 674 675 676 677 678 679680 681 682 683 684 685 686 687 688 689690 691 692 693 694 695 696 697 698 699700 701 702 703 704 705 706 707 708 709710 711 712 713 714 715 716 717 718 719720 721 722 723 724 725 726 727 728 729730 731 732 733 734 735 736 737 738 739740 741 742 743 744 745 746 747 748 749750 751 752 753 754 755 756 757 758 759760 761 762 763 764 765 766 767 768 769770 771 772 773 774 775 776 777 778 779780 781 782 783 784 785 786 787 788 789790 791 792 793 794 795 796 797 798 799800 801 802 803 804 805 806 807 808 809810 811 812 813 814 815 816 817 818 819820 821 822 823 824 825 826 827 828 829830 831 832 833 834 835 836 837 838 839840 841 842 843 844 845 846 847 848 849850 851 852 853 854 855 856 857 858 859860 861 862 863 864 865 866 867 868 869870 871 872 873 874 875 876 877 878 879880 881 882 883 884 885 886 887 888 889890 891 892 893 894 895 896 897 898 899900 901 902 903 904 905 906 907 908 909910 911 912 913 914 915 916 917 918 919920 921 922 923 924 925 926 927 928 929930 931 932 933 934 935 936 937 938 939940 941 942 943 944 945 946 947 948 949950 951 952 953 954 955 956 957 958 959960 961 962 963 964 965 966 967 968 969970 971 972 973 974 975 976 977 978 979980 981 982 983 984 985 986 987 988 989990 991 992 993 994 995 996 997 998 999' as long_query
Query set global general_log = off
deallocate prepare long_query;
-set global general_log = @old_general_log_state;
-SET @old_slow_log_state = @@global.slow_query_log;
+set global general_log = @saved_general_log;
+DROP TABLE IF EXISTS log_count;
+DROP TABLE IF EXISTS slow_log_copy;
+DROP TABLE IF EXISTS general_log_copy;
+CREATE TABLE log_count (count BIGINT(21));
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
+DROP TABLE slow_log_copy;
+CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
+DROP TABLE general_log_copy;
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
+DROP TABLE slow_log_copy;
+CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
+DROP TABLE general_log_copy;
+SET GLOBAL general_log = @saved_general_log;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
+DROP TABLE log_count;
SET SESSION long_query_time = 0;
SET GLOBAL slow_query_log = ON;
FLUSH LOGS;
@@ -858,5 +893,7 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1
TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
-SET GLOBAL slow_query_log = @old_slow_log_state;
-SET SESSION long_query_time =@old_long_query_time;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
+SET GLOBAL general_log=@saved_general_log;
+SET SESSION long_query_time =@saved_long_query_time;
+SET GLOBAL LOG_OUTPUT = @saved_log_output;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index d7a1ea2c704..7d8f052ef84 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -832,7 +832,7 @@ ERROR HY000: Unable to open underlying table which is differently defined or of
DROP TABLE t1, t2;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
SELECT * FROM t2;
-ERROR 42S02: Table 'test.t3' doesn't exist
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t2;
CREATE TABLE t1(a INT, b TEXT);
CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1);
@@ -897,17 +897,19 @@ drop table t2;
drop table t1;
CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2);
SELECT * FROM tm1;
-ERROR 42S02: Table 'test.t1' doesn't exist
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
test.tm1 check Error Table 'test.t1' doesn't exist
+test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
CREATE TABLE t1(a INT);
SELECT * FROM tm1;
-ERROR 42S02: Table 'test.t2' doesn't exist
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
test.tm1 check Error Table 'test.t2' doesn't exist
+test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
CREATE TABLE t2(a BLOB);
SELECT * FROM tm1;
@@ -1201,7 +1203,7 @@ c1
3
RENAME TABLE t2 TO t5;
SELECT * FROM t3 ORDER BY c1;
-ERROR 42S02: Table 'test.t2' doesn't exist
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
RENAME TABLE t5 TO t2;
SELECT * FROM t3 ORDER BY c1;
c1
@@ -1235,7 +1237,7 @@ UNLOCK TABLES;
# 4. Alter table rename.
ALTER TABLE t2 RENAME TO t5;
SELECT * FROM t3 ORDER BY c1;
-ERROR 42S02: Table 'test.t2' doesn't exist
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
ALTER TABLE t5 RENAME TO t2;
SELECT * FROM t3 ORDER BY c1;
c1
@@ -1319,7 +1321,7 @@ LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
SELECT * FROM t2;
-ERROR 42S02: Table 'test.t1' doesn't exist
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist
UNLOCK TABLES;
@@ -2008,6 +2010,13 @@ test.t1 optimize status OK
FLUSH TABLES m1, t1;
UNLOCK TABLES;
DROP TABLE t1, m1;
+CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST;
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
+TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
+DROP TABLE tm1;
+End of 5.1 tests
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 4d5a170a55c..6b498e55d85 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -181,4 +181,21 @@ c1 c2
3 3
DROP VIEW v1,v2;
DROP TABLE t1,t2;
+CREATE TABLE t1 (i INT, d DATE);
+INSERT INTO t1 VALUES (1, '2008-01-01'), (2, '2008-01-02'), (3, '2008-01-03');
+SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d),
+CASE i WHEN i THEN d ELSE d END, GREATEST(d, d), LEAST(d, d)
+FROM t1 ORDER BY RAND();
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01
+2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02
+2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03
+COALESCE(d, d) IFNULL(d, d) IF(i, d, d) CASE i WHEN i THEN d ELSE d END GREATEST(d, d) LEAST(d, d)
+def CASE i WHEN i THEN d ELSE d END CASE i WHEN i THEN d ELSE d END 10 10 10 Y 128 0 63
+def COALESCE(d, d) COALESCE(d, d) 10 10 10 Y 128 0 63
+def GREATEST(d, d) GREATEST(d, d) 10 10 10 Y 128 0 63
+def IF(i, d, d) IF(i, d, d) 10 10 10 Y 128 0 63
+def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
+def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index 2d118092a2c..c1c61cd7fe8 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -277,3 +277,16 @@ drop table t3;
drop table t4;
drop table t5;
drop table t6;
+SELECT @@global.storage_engine INTO @old_engine;
+SET GLOBAL storage_engine=InnoDB;
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES();
+SELECT COUNT(*) FROM v1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM v1;
+COUNT(*)
+1
+DROP VIEW v1;
+DROP TABLE t1;
+SET GLOBAL storage_engine=@old_engine;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 27da8fe5470..83d5ec284c1 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1,3 +1,8 @@
+Bug#37938 - Test "mysqldump" lacks various insert statements
+Turn off concurrent inserts to avoid random errors
+NOTE: We reset the variable back to saved value at the end of test
+SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT = 0;
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
drop database if exists mysqldump_test_db;
drop database if exists db1;
@@ -1999,7 +2004,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
@@ -2096,7 +2101,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
@@ -2170,7 +2175,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
@@ -2286,7 +2291,7 @@ SET character_set_client = utf8;
`a` int(11),
`b` int(11),
`c` varchar(30)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
@@ -2294,7 +2299,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` int(11)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
@@ -2304,7 +2309,7 @@ SET character_set_client = utf8;
`a` int(11),
`b` int(11),
`c` varchar(30)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
@@ -3041,7 +3046,7 @@ SET character_set_client = utf8;
`a` int(11),
`b` varchar(32),
`c` varchar(32)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
@@ -3051,7 +3056,7 @@ SET character_set_client = utf8;
`a` int(11),
`b` varchar(32),
`c` varchar(32)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
@@ -3061,7 +3066,7 @@ SET character_set_client = utf8;
`a` int(11),
`b` varchar(32),
`c` varchar(32)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
USE `test`;
@@ -3441,7 +3446,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
USE `mysqldump_test_db`;
@@ -3501,7 +3506,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `nasishnasifu` (
`id` bigint(20) unsigned
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
USE `mysqldump_tables`;
@@ -3959,7 +3964,7 @@ SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
-) */;
+) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
USE `mysqldump_test_db`;
@@ -4089,6 +4094,7 @@ DROP DATABASE mysqldump_test_db;
# -- End of test case for Bug#32538.
+SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
#
# End of 5.1 tests
#
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index e70ce75797d..dc29c5ec226 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1428,6 +1428,22 @@ set session max_sort_length= 2180;
select * from t1 order by b;
ERROR HY001: Out of sort memory; increase server sort buffer size
drop table t1;
+#
+# Bug #39844: Query Crash Mysql Server 5.0.67
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+CREATE TABLE t3 (c INT);
+INSERT INTO t1 (a) VALUES (1), (2);
+INSERT INTO t2 (a,b) VALUES (1,2), (2,3);
+INSERT INTO t3 (c) VALUES (1), (2);
+SELECT
+(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
+FROM t3;
+(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
+2
+NULL
+DROP TABLE t1, t2, t3;
CREATE TABLE t2 (a varchar(32), b int(11), c float, d double,
UNIQUE KEY a (a,b,c), KEY b (b), KEY c (c));
CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b));
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index a441a841a07..adb055dd5e5 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,4 +1,78 @@
drop table if exists t1, t2;
+CREATE TABLE t1 (a INT NOT NULL, KEY(a))
+PARTITION BY RANGE(a)
+(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (2), (40), (40), (70), (60), (90), (199);
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95 ORDER BY a ASC;
+a
+60
+70
+90
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95;
+a
+60
+70
+90
+INSERT INTO t1 VALUES (200), (250), (210);
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220 ORDER BY a ASC;
+a
+60
+70
+90
+199
+200
+210
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220 ORDER BY a ASC;
+a
+200
+210
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95 ORDER BY a DESC;
+a
+90
+70
+60
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220 ORDER BY a DESC;
+a
+210
+200
+199
+90
+70
+60
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220 ORDER BY a DESC;
+a
+210
+200
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220;
+a
+199
+200
+210
+60
+70
+90
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220;
+a
+200
+210
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95;
+a
+60
+70
+90
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220;
+a
+199
+200
+210
+60
+70
+90
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220;
+a
+200
+210
+DROP TABLE t1;
CREATE TABLE t1 (
a INT NOT NULL,
b MEDIUMINT NOT NULL,
@@ -133,7 +207,10 @@ KEY `c1` (`c1`)
CREATE TABLE `t2` (
`c1` int(11) DEFAULT NULL,
KEY `c1` (`c1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (c1)
+(PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM,
+PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
@@ -299,13 +376,21 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (2) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY KEY (a)
+(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (2) ENGINE = MyISAM) */
alter table t1 reorganize partition p1 into (partition p1 values less than (3));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (3) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY KEY (a)
+(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (3) ENGINE = MyISAM) */
drop table t1;
CREATE TABLE t1 (
a int not null,
@@ -323,7 +408,8 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
drop table t1;
CREATE TABLE t1 (
a int not null,
@@ -500,7 +586,9 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION x1 VALUES IN (1) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION x1 VALUES IN (1) ENGINE = MEMORY) */
drop table t1;
CREATE TABLE t1 (a int, unique(a))
PARTITION BY LIST (a)
@@ -524,7 +612,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */
drop table t1;
CREATE TABLE t1 (a int)
PARTITION BY RANGE (a)
@@ -551,7 +641,11 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM) */
drop table t1;
CREATE TABLE t1 (a int, b int)
PARTITION BY RANGE (a)
@@ -572,7 +666,16 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION x5 VALUES LESS THAN (12) ENGINE = MyISAM, PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM, PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM, PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM,
+ PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM,
+ PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION x5 VALUES LESS THAN (12) ENGINE = MyISAM,
+ PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM,
+ PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM,
+ PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM,
+ PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int not null, b int not null) partition by LIST (a+b) (
partition p0 values in (12),
@@ -626,25 +729,37 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM) */
alter table t1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM) */
alter table t1 engine=myisam;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM) */
alter table t1 engine=heap;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
alter table t1 remove partitioning;
show create table t1;
Table Create Table
@@ -661,7 +776,10 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM) */
alter table t1 add column b int remove partitioning;
show create table t1;
Table Create Table
@@ -678,7 +796,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM) */
alter table t1
engine=heap
partition by key(a)
@@ -688,7 +809,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
alter table t1 engine=myisam, add column c int remove partitioning;
show create table t1;
Table Create Table
@@ -707,7 +831,10 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
alter table t1
partition by key (a)
(partition p0, partition p1);
@@ -717,7 +844,10 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
alter table t1
engine=heap
partition by key (a)
@@ -728,7 +858,10 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
alter table t1
partition by key(a)
(partition p0, partition p1 engine=heap);
@@ -871,14 +1004,23 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM) */
alter table t1 add partition (partition p1 values less than (200)
(subpartition subpart21));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) (SUBPARTITION p0sp0 ENGINE = MyISAM), PARTITION p1 VALUES LESS THAN (200) (SUBPARTITION subpart21 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION p0 VALUES LESS THAN (100)
+ (SUBPARTITION p0sp0 ENGINE = MyISAM),
+ PARTITION p1 VALUES LESS THAN (200)
+ (SUBPARTITION subpart21 ENGINE = MyISAM)) */
drop table t1;
create table t1 (a int)
partition by key (a);
@@ -886,13 +1028,17 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
alter table t1 add partition (partition p1);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM) */
drop table t1;
create table t1 (a int, b int)
partition by range (a)
@@ -969,7 +1115,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p1 VALUES IN (1) ENGINE = MyISAM, PARTITION p2 VALUES IN (2) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p1 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (2) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int unsigned not null auto_increment primary key)
partition by key(a);
@@ -980,7 +1129,8 @@ t2 CREATE TABLE `t2` (
`a` int(10) unsigned NOT NULL AUTO_INCREMENT,
`c` char(10) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment'
+/*!50100 PARTITION BY KEY (a) */
drop table t2;
create table t1 (f1 int) partition by hash (f1) as select 1;
drop table t1;
@@ -1177,7 +1327,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM) */
DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
@@ -1213,7 +1365,9 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) /*!50100 PARTITION BY KEY (a) (PARTITION p0) */
+)
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0) */
set session sql_mode='';
drop table t1;
create table t1 (a int)
@@ -1227,7 +1381,8 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(1) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
drop table t1;
CREATE TABLE t1 (a int) ENGINE = MYISAM PARTITION BY KEY(a);
INSERT into t1 values (1), (2);
@@ -1299,7 +1454,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE),
(18446744073709551613), (18446744073709551612);
select * from t1;
@@ -1448,13 +1605,15 @@ create trigger t_ad after delete on t for each row insert into t values (old.s1)
insert into t values (1);
drop table t;
USE mysql;
+TRUNCATE TABLE general_log;
+SET @old_general_log_state = @@global.general_log;
SET GLOBAL general_log = 0;
ALTER TABLE general_log ENGINE = MyISAM;
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
ERROR HY000: Incorrect usage of PARTITION and log table
ALTER TABLE general_log ENGINE = CSV;
-SET GLOBAL general_log = default;
+SET GLOBAL general_log = @old_general_log_state;
use test;
create table t2 (b int);
create table t1 (b int)
@@ -1473,7 +1632,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (b)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) */
drop table t1, t2;
create table t1
(s1 timestamp on update current_timestamp, s2 int)
@@ -1610,7 +1772,13 @@ t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`user` char(25) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+SUBPARTITION BY HASH (id)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
drop table t1;
CREATE TABLE t1 (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -1637,4 +1805,93 @@ select count(*) from t1, t2 where t1.createdDate = t2.createdDate;
count(*)
1
drop table t1, t2;
+SET @orig_sql_mode = @@SQL_MODE;
+SET SQL_MODE='STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
+CREATE TABLE t1 (c1 INT)
+PARTITION BY LIST(1 DIV c1) (
+PARTITION p0 VALUES IN (NULL),
+PARTITION p1 VALUES IN (1)
+);
+INSERT INTO t1 VALUES (0);
+ERROR 22012: Division by 0
+SELECT * FROM t1;
+c1
+TRUNCATE t1;
+INSERT INTO t1 VALUES (NULL), (0), (1), (2);
+ERROR 22012: Division by 0
+SELECT * FROM t1;
+c1
+NULL
+DROP TABLE t1;
+SET SQL_MODE= @orig_sql_mode;
+create table t1 (s1 int) partition by hash(s1) partitions 2;
+create index i on t1 (s1);
+insert into t1 values (1);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+select * from t1;
+s1
+1
+1
+1
+1
+1
+1
+1
+1
+drop table t1;
+create table t1 (s1 int) partition by range(s1)
+(partition pa1 values less than (10),
+partition pa2 values less than MAXVALUE);
+create index i on t1 (s1);
+insert into t1 values (1);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+select * from t1;
+s1
+1
+1
+1
+1
+1
+1
+1
+1
+drop table t1;
+create table t1 (s1 int) partition by range(s1)
+(partition pa1 values less than (10),
+partition pa2 values less than MAXVALUE);
+create index i on t1 (s1);
+insert into t1 values (20);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+select * from t1;
+s1
+20
+20
+20
+20
+20
+20
+20
+20
+drop table t1;
+create table t1 (s1 int) partition by range(s1)
+(partition pa1 values less than (10),
+partition pa2 values less than MAXVALUE);
+create index i on t1 (s1);
+insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+insert into t1 select s1 from t1 where s1=3;
+select count(*) from t1;
+count(*)
+288
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_archive.result b/mysql-test/r/partition_archive.result
index 5c84b41e81b..de64b09e042 100644
--- a/mysql-test/r/partition_archive.result
+++ b/mysql-test/r/partition_archive.result
@@ -60,7 +60,8 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a) */
drop table t1;
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
f1 VARCHAR(25),
@@ -84,7 +85,21 @@ t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`f1` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE, PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE, PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE, PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE, PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE, PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE, PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE, PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE, PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+SUBPARTITION BY HASH (id)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE,
+ PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE,
+ PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE,
+ PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE,
+ PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE,
+ PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE,
+ PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE,
+ PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE,
+ PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE,
+ PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
select count(*) from t1;
count(*)
100
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 43d9aac13b7..3e4acfdee12 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -326,7 +326,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM, PARTITION p2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION p1 ENGINE = MyISAM,
+ PARTITION p2 ENGINE = MyISAM) */
insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
select hex(a) from t1 where a = 7;
hex(a)
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 6e56f9023eb..3692626f9ac 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,3 +1,68 @@
+# Bug#37721, test of ORDER BY on PK and WHERE on INDEX
+CREATE TABLE t1 (
+a INT,
+b INT,
+PRIMARY KEY (a),
+INDEX (b))
+ENGINE InnoDB
+PARTITION BY HASH(a)
+PARTITIONS 3;
+INSERT INTO t1 VALUES (0,0),(4,0),(2,0);
+SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
+a
+0
+2
+4
+SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
+a
+4
+2
+0
+ALTER TABLE t1 DROP INDEX b;
+SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
+a
+0
+2
+4
+SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
+a
+4
+2
+0
+DROP TABLE t1;
+CREATE TABLE t1 (
+a VARCHAR(600),
+b VARCHAR(600),
+PRIMARY KEY (a),
+INDEX (b))
+ENGINE InnoDB
+PARTITION BY KEY(a)
+PARTITIONS 3;
+INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'1'),repeat('0',257));
+INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'3'),repeat('0',257));
+INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'2'),repeat('0',257));
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
+right(a,1)
+1
+2
+3
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
+right(a,1)
+3
+2
+1
+ALTER TABLE t1 DROP INDEX b;
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
+right(a,1)
+1
+2
+3
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
+right(a,1)
+3
+2
+1
+DROP TABLE t1;
# Bug#32948
CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1),
@@ -72,7 +137,8 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
drop table t1;
create table t1 (a int)
engine = innodb
@@ -84,7 +150,9 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
drop table t1;
create table t1
(
@@ -160,5 +228,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`int_column` int(11) DEFAULT NULL,
`char_column` char(5) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (int_column) SUBPARTITION BY KEY (char_column) SUBPARTITIONS 2 (PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (int_column)
+SUBPARTITION BY KEY (char_column)
+SUBPARTITIONS 2
+(PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
drop table t1;
diff --git a/mysql-test/r/partition_innodb_stmt.result b/mysql-test/r/partition_innodb_stmt.result
new file mode 100644
index 00000000000..2735b0d2193
--- /dev/null
+++ b/mysql-test/r/partition_innodb_stmt.result
@@ -0,0 +1,48 @@
+# connection default
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+CREATE TABLE t1
+(
+id SMALLINT NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=innodb
+PARTITION BY RANGE (id)
+(
+PARTITION p1 VALUES LESS THAN (2),
+PARTITION p2 VALUES LESS THAN (4),
+PARTITION p3 VALUES LESS THAN (10)
+);
+INSERT INTO t1 VALUES (1),(2),(3);
+# Test READ COMMITTED -> REPEATABLE READ
+FLUSH TABLES;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+BEGIN;
+SELECT * FROM t1;
+id
+1
+2
+3
+#connection con1
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+BEGIN;
+INSERT INTO t1 VALUES(7);
+COMMIT;
+# connection default
+COMMIT;
+FLUSH TABLES;
+# Test REPEATABLE READ -> READ COMMITTED
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+BEGIN;
+SELECT * FROM t1;
+id
+1
+2
+3
+7
+# connection con1
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+BEGIN;
+INSERT INTO t1 VALUES(9);
+ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
+COMMIT;
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index 9ef220028b3..465bddcb3fb 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -16,14 +16,18 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+PARTITIONS 2 */
ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+PARTITIONS 1 */
drop table t1;
create table t1 (a int)
partition by list (a)
@@ -36,3 +40,42 @@ alter table t1 REORGANIZE partition p1 INTO
(partition p11 values in (1,2),
partition p12 values in (3,4));
drop table t1;
+CREATE TABLE t1 (a INT)
+/*!50100 PARTITION BY HASH (a)
+/* Test
+of multi-line
+comment */
+PARTITIONS 5 */;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/' at line 6
+CREATE TABLE t1 (a INT)
+/*!50100 PARTITION BY HASH (a)
+-- with a single line comment embedded
+PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */
+DROP TABLE t1;
+CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result
index 764f6fb5632..db89c6ef6e7 100644
--- a/mysql-test/r/partition_mgm_err.result
+++ b/mysql-test/r/partition_mgm_err.result
@@ -84,6 +84,14 @@ ALTER TABLE t1 DROP PARTITION x1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 COALESCE PARTITION 1;
ERROR HY000: Partition management on a not partitioned table is not possible
+ALTER TABLE t1 ANALYZE PARTITION p1;
+ERROR HY000: Partition management on a not partitioned table is not possible
+ALTER TABLE t1 CHECK PARTITION p1;
+ERROR HY000: Partition management on a not partitioned table is not possible
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
+ERROR HY000: Partition management on a not partitioned table is not possible
+ALTER TABLE t1 REPAIR PARTITION p1;
+ERROR HY000: Partition management on a not partitioned table is not possible
DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY KEY (a)
@@ -136,7 +144,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 2 */
DROP TABLE t1;
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
diff --git a/mysql-test/r/partition_not_windows.result b/mysql-test/r/partition_not_windows.result
index 44afdea3855..fa22b796a28 100644
--- a/mysql-test/r/partition_not_windows.result
+++ b/mysql-test/r/partition_not_windows.result
@@ -24,13 +24,15 @@ data directory='/not/existing'
index directory='/not/existing'
);
Warnings:
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
DROP TABLE t1, t2;
set @@sql_mode=@org_mode;
CREATE TABLE t1(a INT)
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index e4e5a748b0d..e8fc55b759b 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -8,7 +8,9 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
drop table t1;
create table t1 (a integer)
partition by range (a)
@@ -137,7 +139,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM,
+ PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM,
+ PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */
ALTER TABLE t1
partition by range (a)
partitions 3
@@ -157,7 +163,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM,
+ PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM,
+ PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */
drop table if exists t1;
CREATE TABLE t1 (
a int not null,
@@ -254,7 +264,15 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a+b)
+(PARTITION x1 VALUES LESS THAN (1)
+ (SUBPARTITION x11 ENGINE = MyISAM,
+ SUBPARTITION x12 ENGINE = MyISAM),
+ PARTITION x2 VALUES LESS THAN (5)
+ (SUBPARTITION x21 ENGINE = MyISAM,
+ SUBPARTITION x22 ENGINE = MyISAM)) */
ALTER TABLE t1 ADD COLUMN d int;
show create table t1;
Table Create Table
@@ -264,7 +282,15 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL,
`d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a+b)
+(PARTITION x1 VALUES LESS THAN (1)
+ (SUBPARTITION x11 ENGINE = MyISAM,
+ SUBPARTITION x12 ENGINE = MyISAM),
+ PARTITION x2 VALUES LESS THAN (5)
+ (SUBPARTITION x21 ENGINE = MyISAM,
+ SUBPARTITION x22 ENGINE = MyISAM)) */
drop table t1;
CREATE TABLE t1 (
a int not null,
@@ -487,7 +513,10 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
drop table t1;
create table t1 (a bigint unsigned)
partition by range (a)
@@ -497,7 +526,10 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
insert into t1 values (0xFFFFFFFFFFFFFFFF);
ERROR HY000: Table has no partition for value 18446744073709551615
drop table t1;
@@ -742,3 +774,23 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where
DROP TABLE t1;
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t2 (
+defid int(10) unsigned NOT NULL,
+day int(10) unsigned NOT NULL,
+count int(10) unsigned NOT NULL,
+filler char(200),
+KEY (defid,day)
+)
+PARTITION BY RANGE (day) (
+PARTITION p7 VALUES LESS THAN (20070401) ,
+PARTITION p8 VALUES LESS THAN (20070501));
+insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B;
+insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B;
+insert into t2 values(52, 20070321, 123, 'filler') ;
+insert into t2 values(52, 20070322, 456, 'filler') ;
+select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
+sum(count)
+579
+drop table t1, t2;
diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result
index 73844e9e70d..60184d11d9c 100644
--- a/mysql-test/r/partition_symlink.result
+++ b/mysql-test/r/partition_symlink.result
@@ -101,13 +101,15 @@ data directory='/not/existing'
index directory='/not/existing'
);
Warnings:
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
DROP TABLE t1, t2;
set @@sql_mode=@org_mode;
create table t1 (a int)
diff --git a/mysql-test/r/partition_windows.result b/mysql-test/r/partition_windows.result
index c2d4054deeb..756690925f8 100644
--- a/mysql-test/r/partition_windows.result
+++ b/mysql-test/r/partition_windows.result
@@ -15,16 +15,16 @@ DATA DIRECTORY = 'E:/mysqltest/p2Data'
INDEX DIRECTORY = 'F:/mysqltest/p2Index'
);
Warnings:
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "first", 1);
INSERT INTO t1 VALUES (NULL, "second", 2);
INSERT INTO t1 VALUES (NULL, "third", 3);
ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index');
Warnings:
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "last", 4);
DROP TABLE t1;
diff --git a/mysql-test/r/ps_11bugs.result b/mysql-test/r/ps_11bugs.result
index ebe161f46b3..a298c552806 100644
--- a/mysql-test/r/ps_11bugs.result
+++ b/mysql-test/r/ps_11bugs.result
@@ -162,4 +162,32 @@ a b
12 NULL
drop table t1;
drop table t2;
+CREATE TABLE t1 (a INT);
+PREPARE stmt FROM 'select 1 from `t1` where `a` = any (select (@@tmpdir))';
+EXECUTE stmt;
+1
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (400000), (400001);
+SET @@sort_buffer_size=400000;
+CREATE FUNCTION p1(i INT) RETURNS INT
+BEGIN
+SET @@sort_buffer_size= i;
+RETURN i + 1;
+END|
+SELECT * FROM t2 WHERE a = @@sort_buffer_size AND p1(@@sort_buffer_size + 1) > a - 1;
+a
+400000
+DROP TABLE t2;
+DROP FUNCTION p1;
+SELECT CONCAT(@@sort_buffer_size);
+CONCAT(@@sort_buffer_size)
+400001
+SELECT LEFT("12345", @@ft_boolean_syntax);
+LEFT("12345", @@ft_boolean_syntax)
+
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '+ -><()~*:""&|'
+SET @@sort_buffer_size=DEFAULT;
End of 5.0 tests.
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index dfadfd878e8..b9a5ddbf8ec 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1001,8 +1001,8 @@ def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
def TRIGGERS CREATED Created 12 19 0 Y 128 0 63
-def TRIGGERS SQL_MODE sql_mode 252 589815 0 N 17 0 33
-def TRIGGERS DEFINER Definer 252 589815 14 N 17 0 33
+def TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
+def TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
@@ -1045,8 +1045,8 @@ def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y
def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
-def TRIGGERS SQL_MODE SQL_MODE 252 589815 0 N 17 0 33
-def TRIGGERS DEFINER DEFINER 252 589815 14 N 17 0 33
+def TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
----------------------------------------------------------------
diff --git a/mysql-test/r/slow_launch_time_func.result b/mysql-test/r/slow_launch_time_func.result
index 766d7fb4dd9..7665166ff29 100644
--- a/mysql-test/r/slow_launch_time_func.result
+++ b/mysql-test/r/slow_launch_time_func.result
@@ -1,37 +1,17 @@
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
-'#--------------------FN_DYNVARS_124_01-------------------------#'
** Connection default **
+'#--------------------FN_DYNVARS_124_01-------------------------#'
SET @@GLOBAL.slow_launch_time=0;
SELECT @@GLOBAL.slow_launch_time;
@@GLOBAL.slow_launch_time
0
-** Connecting conn5 using username 'root' **
-** Connecting conn6 using username 'root' **
-** Connecting conn7 using username 'root' **
-** Connecting conn8 using username 'root' **
-** Connecting conn9 using username 'root' **
-** Connecting conn10 using username 'root' **
-** Connecting conn11 using username 'root' **
-** Connecting conn12 using username 'root' **
-** Connecting conn13 using username 'root' **
-** Connecting conn14 using username 'root' **
-** Connecting conn15 using username 'root' **
-** Connecting conn16 using username 'root' **
-show status like 'slow_launch_threads';
-Variable_name Value
-Slow_launch_threads 12
-12 Expected
-** Connection default **
-** Disconnecting conn5 **
-** Disconnecting conn6 **
-** Disconnecting conn7 **
-** Disconnecting conn8 **
-** Disconnecting conn9 **
-** Disconnecting conn10 **
-** Disconnecting conn11 **
-** Disconnecting conn12 **
-** Disconnecting conn13 **
-** Disconnecting conn14 **
-** Disconnecting conn15 **
-** Disconnecting conn16 **
+** Connecting conn1 using username 'root' **
+** Switch to connection default and disconnect conn1 **
+'#--------------------FN_DYNVARS_124_02-------------------------#'
+SET @@GLOBAL.slow_launch_time= 1000;
+SELECT @@GLOBAL.slow_launch_time;
+@@GLOBAL.slow_launch_time
+1000
+** Connecting conn2 using username 'root' **
+** Switch to connection default and disconnect conn2 **
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index cc383d003e9..2f8f71077a6 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1628,6 +1628,13 @@ end loop label1;
end loop;
end|
ERROR 42000: End-label label1 without match
+CREATE TABLE t1 (a INT)|
+INSERT INTO t1 VALUES (1),(2)|
+CREATE PROCEDURE p1(a INT) BEGIN END|
+CALL p1((SELECT * FROM t1))|
+ERROR 21000: Subquery returns more than 1 row
+DROP PROCEDURE IF EXISTS p1|
+DROP TABLE t1|
drop procedure if exists p1;
create procedure p1()
begin
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index d37c728d6fb..6b58b939a07 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6820,6 +6820,24 @@ ttt
2
drop function func30787;
drop table t1;
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+CREATE PROCEDURE test_sp()
+SELECT t1.* FROM t1 RIGHT JOIN t1 t2 ON t1.id=t2.id;
+CALL test_sp();
+id
+1
+2
+3
+4
+CALL test_sp();
+id
+1
+2
+3
+4
+DROP PROCEDURE test_sp;
+DROP TABLE t1;
create table t1(c1 INT);
create function f1(p1 int) returns varchar(32)
return 'aaa';
@@ -6836,6 +6854,29 @@ drop procedure p1;
drop function f1;
drop view v1;
drop table t1;
+drop procedure if exists `p2` $
+create procedure `p2`(in `a` text charset utf8)
+begin
+declare `pos` int default 1;
+declare `str` text charset utf8;
+set `str` := `a`;
+select substr(`str`, `pos`+ 1 ) into `str`;
+end $
+call `p2`('s s s s s s');
+drop procedure `p2`;
+drop table if exists t1;
+drop procedure if exists p1;
+create procedure p1() begin select * from t1; end$
+call p1$
+ERROR 42S02: Table 'test.t1' doesn't exist
+create table t1 (a integer)$
+call p1$
+a
+alter table t1 add b integer;
+call p1$
+a
+drop table t1;
+drop procedure p1;
# ------------------------------------------------------------------
# -- End of 5.0 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/r/ssl_capath_basic.result b/mysql-test/r/ssl_capath_basic.result
index a2c01aab806..3d161392917 100644
--- a/mysql-test/r/ssl_capath_basic.result
+++ b/mysql-test/r/ssl_capath_basic.result
@@ -1,7 +1,7 @@
'#---------------------BS_STVARS_046_01----------------------#'
SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath)
-0
+1
1 Expected
'#---------------------BS_STVARS_046_02----------------------#'
SET @@GLOBAL.ssl_capath=1;
@@ -9,7 +9,7 @@ ERROR HY000: Variable 'ssl_capath' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath)
-0
+1
1 Expected
'#---------------------BS_STVARS_046_03----------------------#'
SELECT @@GLOBAL.ssl_capath = VARIABLE_VALUE
@@ -20,7 +20,7 @@ NULL
1 Expected
SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath)
-0
+1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_046_05----------------------#'
SELECT COUNT(@@ssl_capath);
COUNT(@@ssl_capath)
-0
+1
1 Expected
SELECT COUNT(@@local.ssl_capath);
ERROR HY000: Variable 'ssl_capath' is a GLOBAL variable
@@ -46,7 +46,7 @@ ERROR HY000: Variable 'ssl_capath' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath)
-0
+1
1 Expected
SELECT ssl_capath = @@SESSION.ssl_capath;
ERROR 42S22: Unknown column 'ssl_capath' in 'field list'
diff --git a/mysql-test/r/ssl_cipher_basic.result b/mysql-test/r/ssl_cipher_basic.result
index 3c7098e1150..df0fc8b5aad 100644
--- a/mysql-test/r/ssl_cipher_basic.result
+++ b/mysql-test/r/ssl_cipher_basic.result
@@ -1,7 +1,7 @@
'#---------------------BS_STVARS_048_01----------------------#'
SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher)
-0
+1
1 Expected
'#---------------------BS_STVARS_048_02----------------------#'
SET @@GLOBAL.ssl_cipher=1;
@@ -9,7 +9,7 @@ ERROR HY000: Variable 'ssl_cipher' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher)
-0
+1
1 Expected
'#---------------------BS_STVARS_048_03----------------------#'
SELECT @@GLOBAL.ssl_cipher = VARIABLE_VALUE
@@ -20,7 +20,7 @@ NULL
1 Expected
SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher)
-0
+1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_048_05----------------------#'
SELECT COUNT(@@ssl_cipher);
COUNT(@@ssl_cipher)
-0
+1
1 Expected
SELECT COUNT(@@local.ssl_cipher);
ERROR HY000: Variable 'ssl_cipher' is a GLOBAL variable
@@ -46,7 +46,7 @@ ERROR HY000: Variable 'ssl_cipher' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher)
-0
+1
1 Expected
SELECT ssl_cipher = @@SESSION.ssl_cipher;
ERROR 42S22: Unknown column 'ssl_cipher' in 'field list'
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index 97547ff7c47..1e758ce68c7 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -1,3 +1,5 @@
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 0;
flush status;
show status like 'Table_lock%';
Variable_name Value
@@ -7,22 +9,31 @@ select * from information_schema.session_status where variable_name like 'Table_
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 2
TABLE_LOCKS_WAITED 0
-SET SQL_LOG_BIN=0;
+# Switched to connection: con1
+set sql_log_bin=0;
set @old_general_log = @@global.general_log;
set global general_log = 'OFF';
drop table if exists t1;
create table t1(n int) engine=myisam;
insert into t1 values(1);
+select 1;
+1
+1
+# Switched to connection: con2
lock tables t1 read;
unlock tables;
lock tables t1 read;
+# Switched to connection: con1
update t1 set n = 3;
+# Switched to connection: con2
unlock tables;
+# Switched to connection: con1
show status like 'Table_locks_waited';
Variable_name Value
Table_locks_waited 1
drop table t1;
set global general_log = @old_general_log;
+# Switched to connection: default
select 1;
1
1
@@ -198,3 +209,4 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table '
drop database db37908;
drop procedure proc37908;
drop function func37908;
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index f4fd041731d..b15ec9dbe4e 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -779,6 +779,22 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
1
1
DROP TABLE t1, t2;
+CREATE TABLE t1 (
+pk INT PRIMARY KEY,
+int_key INT,
+varchar_key VARCHAR(5) UNIQUE,
+varchar_nokey VARCHAR(5)
+);
+INSERT INTO t1 VALUES (9, 7,NULL,NULL), (10,8,'p' ,'p');
+SELECT varchar_nokey
+FROM t1
+WHERE NULL NOT IN (
+SELECT INNR.pk FROM t1 AS INNR2
+LEFT JOIN t1 AS INNR ON ( INNR2.int_key = INNR.int_key )
+WHERE INNR.varchar_key > 'n{'
+);
+varchar_nokey
+DROP TABLE t1;
End of 5.0 tests
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index b8c1660f947..7711517fe5e 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -79,7 +79,7 @@ drop database mysqltest;
create table t1 (a int not null) engine=myisam;
alter table t1 data directory="MYSQLTEST_VARDIR/tmp";
Warnings:
-Warning 0 DATA DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -88,7 +88,7 @@ t1 CREATE TABLE `t1` (
alter table t1 add b int;
alter table t1 data directory="MYSQLTEST_VARDIR/log";
Warnings:
-Warning 0 DATA DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -97,7 +97,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 index directory="MYSQLTEST_VARDIR/log";
Warnings:
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -164,8 +164,8 @@ ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errco
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp';
Warnings:
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
DROP TABLE t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
End of 5.1 tests
diff --git a/mysql-test/r/thread_cache_size_func.result b/mysql-test/r/thread_cache_size_func.result
index ccca75bd316..f808e28a512 100644
--- a/mysql-test/r/thread_cache_size_func.result
+++ b/mysql-test/r/thread_cache_size_func.result
@@ -2,67 +2,31 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
FLUSH STATUS;
'# Test1#'
SET @@GLOBAL.thread_cache_size=3;
-Saving threads cached, threads created values
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
-'#Old value for thread_cache'#
** Connecting conn1 using username 'root' **
** Connecting conn2 using username 'root' **
** Connecting conn3 using username 'root' **
** Connecting conn4 using username 'root' **
-Saving threads cached, threads created values
-Threads Created Difference
-4
-4 Expected
+** Connection default **
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
-** Connection default **
** Disconnecting conn1,conn2,conn3,conn4 **
-'#new values for thread cache after disconnecting'#
-Saving threads cached, threads created values
-Threads Created Difference
-0
-0 Expected
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 3
3 Expected
-SET @@GLOBAL.thread_cache_size=1;
-Saving threads cached, threads created values
-Threads Created Difference
-0
-0 Expected
-SHOW STATUS LIKE 'Threads_cached';
-Variable_name Value
-Threads_cached 3
-1 Expected
-Bug: The number of threads cached should have decreased with cache size decrease.
+SET @@GLOBAL.thread_cache_size= 1;
** Connecting conn1 using username 'root' **
** Connecting conn2 using username 'root' **
-Saving threads cached, threads created values
-Threads Created Difference
-0
-1 Expected
-Bug: The number of threads created should have increased because the cache should have 1 thread only
-SHOW STATUS LIKE 'Threads_cached';
-Variable_name Value
-Threads_cached 1
-0 Expected
-Bug: The number of threads created should have decreased because atleast 1 new connection came in
-** Connection default **
+connection default;
** Disconnecting conn1,conn2 **
-'#new status values for thread cache'#
-Saving threads cached, threads created values
-Threads Created Difference
-0
-0 Expected
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 1
1 Expected
-Saving threads cached, threads created values
SET @@GLOBAL.thread_cache_size = @global_thread_cache_size;
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
index 9e0f1e2c351..2c4e355af9d 100644
--- a/mysql-test/r/trigger-trans.result
+++ b/mysql-test/r/trigger-trans.result
@@ -161,3 +161,32 @@ SELECT @a, @b;
1 1
DROP TABLE t2, t1;
End of 5.0 tests
+BUG#31612
+Trigger fired multiple times leads to gaps in auto_increment sequence
+create table t1 (a int, val char(1)) engine=InnoDB;
+create table t2 (b int auto_increment primary key,
+val char(1)) engine=InnoDB;
+create trigger t1_after_insert after
+insert on t1 for each row insert into t2 set val=NEW.val;
+insert into t1 values ( 123, 'a'), ( 123, 'b'), ( 123, 'c'),
+(123, 'd'), (123, 'e'), (123, 'f'), (123, 'g');
+insert into t1 values ( 654, 'a'), ( 654, 'b'), ( 654, 'c'),
+(654, 'd'), (654, 'e'), (654, 'f'), (654, 'g');
+select * from t2 order by b;
+b val
+1 a
+2 b
+3 c
+4 d
+5 e
+6 f
+7 g
+8 a
+9 b
+10 c
+11 d
+12 e
+13 f
+14 g
+drop trigger t1_after_insert;
+drop table t1,t2;
diff --git a/mysql-test/r/tx_isolation_func.result b/mysql-test/r/tx_isolation_func.result
index 8b763edd70c..2242525f14b 100644
--- a/mysql-test/r/tx_isolation_func.result
+++ b/mysql-test/r/tx_isolation_func.result
@@ -21,8 +21,10 @@ INSERT INTO t1 VALUES(24, 24);
'#----------------------------FN_DYNVARS_184_01--------------------------------------#'
** Connection con0 **
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+set binlog_format=mixed;
** Connection con1 **
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+set binlog_format=mixed;
** Connection con0 **
START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8) FOR UPDATE;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 2cd132ce03c..2d91835d723 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -121,8 +121,8 @@ select @a:=0;
select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
@a+0 @a:=@a+0+count(*) count(*) @a+0
0 1 1 0
-1 3 2 0
-3 6 3 0
+0 2 2 0
+0 3 3 0
set @a=0;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
@@ -370,4 +370,33 @@ select @rownum := @rownum + 1 as row,
@prev_score := a as score
from t1 order by score desc;
drop table t1;
+create table t1(b bigint);
+insert into t1 (b) values (10), (30), (10);
+set @var := 0;
+select if(b=@var, 999, b) , @var := b from t1 order by b;
+if(b=@var, 999, b) @var := b
+10 10
+999 10
+30 30
+drop table t1;
+create temporary table t1 (id int);
+insert into t1 values (2), (3), (3), (4);
+set @lastid=-1;
+select @lastid != id, @lastid, @lastid := id from t1;
+@lastid != id @lastid @lastid := id
+1 -1 2
+1 2 3
+0 3 3
+1 3 4
+drop table t1;
+create temporary table t1 (id bigint);
+insert into t1 values (2), (3), (3), (4);
+set @lastid=-1;
+select @lastid != id, @lastid, @lastid := id from t1;
+@lastid != id @lastid @lastid := id
+1 -1 2
+1 2 3
+0 3 3
+1 3 4
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 3f66599751d..aee84c98e4f 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -157,7 +157,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity`
+Note 1003 select @@IDENTITY AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,@@identity AS `@@identity`
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
set global concurrent_insert=2;
show variables like 'concurrent_insert';
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index a0af9fdcf1d..90530462732 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3672,6 +3672,8 @@ DROP VIEW v1;
# -- End of test case for Bug#35193.
+CREATE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
# -----------------------------------------------------------------
# -- End of 5.0 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index aad8a33ea61..090ac1340ea 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -167,7 +167,7 @@ max_error_count 10
drop table t1;
set table_type=MYISAM;
Warnings:
-Warning 1287 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead
+Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 5.2. Please use '@@storage_engine' instead
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc';
diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result
index e58a891838a..d056bde4dca 100644
--- a/mysql-test/r/windows.result
+++ b/mysql-test/r/windows.result
@@ -9,8 +9,8 @@ drop table nu;
drop table if exists t1;
CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp/' engine=MyISAM;
Warnings:
-Warning 0 DATA DIRECTORY option ignored
-Warning 0 INDEX DIRECTORY option ignored
+Warning 1618 <DATA DIRECTORY> option ignored
+Warning 1618 <INDEX DIRECTORY> option ignored
drop table t1;
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,1);
@@ -18,6 +18,7 @@ EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+DROP TABLE t1;
End of 5.0 tests.
drop procedure if exists proc_1;
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';
diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result
index 5fb03d2378e..592cf07522b 100644
--- a/mysql-test/r/xa.result
+++ b/mysql-test/r/xa.result
@@ -55,3 +55,23 @@ select * from t1;
a
20
drop table t1;
+drop table if exists t1;
+create table t1(a int, b int, c varchar(20), primary key(a)) engine = innodb;
+insert into t1 values(1, 1, 'a');
+insert into t1 values(2, 2, 'b');
+xa start 'a','b';
+update t1 set c = 'aa' where a = 1;
+xa start 'a','c';
+update t1 set c = 'bb' where a = 2;
+update t1 set c = 'bb' where a = 2;
+update t1 set c = 'aa' where a = 1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+select count(*) from t1;
+count(*)
+2
+xa end 'a','c';
+ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
+xa rollback 'a','c';
+xa start 'a','c';
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
new file mode 100644
index 00000000000..ca5067c4e1f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
@@ -0,0 +1,25 @@
+flush status;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 0
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 2
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result
index ffe7915f1f8..a295657b8f8 100644
--- a/mysql-test/suite/binlog/r/binlog_multi_engine.result
+++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result
@@ -43,8 +43,6 @@ INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1n;
@@ -68,20 +66,21 @@ RESET MASTER;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
+ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1m)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1b)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1n)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 9668c7ce5ea..1a56e048b27 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -1090,6 +1090,53 @@ master-bin.000001 295 Table_map 1 337 table_id: # (test.t1)
master-bin.000001 337 Write_rows 1 383 table_id: # flags: STMT_END_F
master-bin.000001 383 Query 1 452 use `test`; COMMIT
master-bin.000001 452 Query 1 528 use `test`; drop table t1
+reset master;
+CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+USE bug39182;
+CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END//
+CALL p1();
+c1 c2 c3 d1 d2 d3
+utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP DATABASE bug39182;
+USE test;
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
diff --git a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
index e6813ee2719..ca5067c4e1f 100644
--- a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
@@ -1,3 +1,4 @@
+flush status;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 0
@@ -22,18 +23,3 @@ show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
-show status like "Innodb_buffer_pool_pages_total";
-Variable_name Value
-Innodb_buffer_pool_pages_total 512
-show status like "Innodb_page_size";
-Variable_name Value
-Innodb_page_size 16384
-show status like "Innodb_rows_deleted";
-Variable_name Value
-Innodb_rows_deleted 2000
-show status like "Innodb_rows_inserted";
-Variable_name Value
-Innodb_rows_inserted 2000
-show status like "Innodb_rows_updated";
-Variable_name Value
-Innodb_rows_updated 0
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index ae8c1e11737..aadbf950b21 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -594,6 +594,56 @@ master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
master-bin.000001 227 Query 1 351 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
master-bin.000001 351 Query 1 427 use `test`; drop table t1
+reset master;
+CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+USE bug39182;
+CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END//
+CALL p1();
+c1 c2 c3 d1 d2 d3
+utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END
+master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%")
+master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE tmp1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP DATABASE bug39182;
+USE test;
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
index 619fd39a2a9..30f298488fc 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
@@ -141,7 +141,6 @@ master-bin.000001 # Query # # use `test`; COMMIT
drop table t1,t2,t3;
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
INSERT DELAYED INTO t1 VALUES(1);
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
index e6813ee2719..ca5067c4e1f 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
@@ -1,3 +1,4 @@
+flush status;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 0
@@ -22,18 +23,3 @@ show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
-show status like "Innodb_buffer_pool_pages_total";
-Variable_name Value
-Innodb_buffer_pool_pages_total 512
-show status like "Innodb_page_size";
-Variable_name Value
-Innodb_page_size 16384
-show status like "Innodb_rows_deleted";
-Variable_name Value
-Innodb_rows_deleted 2000
-show status like "Innodb_rows_inserted";
-Variable_name Value
-Innodb_rows_inserted 2000
-show status like "Innodb_rows_updated";
-Variable_name Value
-Innodb_rows_updated 0
diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result
new file mode 100644
index 00000000000..97ec38cfb3e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_row.result
@@ -0,0 +1,71 @@
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+SET GLOBAL BINLOG_FORMAT = STATEMENT;
+SET SESSION BINLOG_FORMAT = STATEMENT;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 LIKE t1;
+select @@SESSION.BINLOG_FORMAT;
+@@SESSION.BINLOG_FORMAT
+STATEMENT
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(2);
+#
+# Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
+# lock that will prevent the source table from being modified.
+#
+# con1
+SELECT GET_LOCK('Bug#34306', 120);
+GET_LOCK('Bug#34306', 120)
+1
+# con2
+PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+EXECUTE stmt;;
+# default
+INSERT INTO t2 VALUES (3);;
+# con1
+SELECT RELEASE_LOCK('Bug#34306');
+RELEASE_LOCK('Bug#34306')
+1
+# con2
+SELECT RELEASE_LOCK('Bug#34306');
+RELEASE_LOCK('Bug#34306')
+1
+# default
+#
+# Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
+# not prevent the source table from being modified if under RBR.
+#
+# con2
+SET SESSION BINLOG_FORMAT = ROW;
+# con1
+SELECT GET_LOCK('Bug#34306', 120);
+GET_LOCK('Bug#34306', 120)
+1
+# con2
+EXECUTE stmt;;
+# default
+# con1
+INSERT INTO t2 VALUES (4);
+SELECT RELEASE_LOCK('Bug#34306');
+RELEASE_LOCK('Bug#34306')
+1
+# con2
+# default
+# Show binlog events
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 LIKE t1
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES(2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (4)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index ab8a8cd59bd..e63186b64c8 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -1,5 +1,10 @@
-- source include/have_innodb.inc
-- source include/have_binlog_format_mixed_or_statement.inc
+
+# You cannot use `KILL' with the Embedded MySQL Server library,
+# because the embedded server merely runs inside the threads of the host
+# application. -- the docs
+
-- source include/not_embedded.inc
###
@@ -22,6 +27,12 @@ select get_lock("a", 20);
connection con2;
let $ID= `select connection_id()`;
+
+#
+# reset master does not reset binlogging on the embedded server.
+# the test is not run on the embedded for reason of using KILL query.
+# `reset master' problem is to be addressed by bug#15580 fixes.
+#
reset master;
send insert into t2 values (null, null), (null, get_lock("a", 10));
diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
index cb3b5a6e827..8af51fc5fe5 100644
--- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test
+++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
@@ -33,7 +33,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
eval select $error_code /* must return 1 as query completed before got killed*/;
# cleanup for the sub-case
-system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
#
@@ -61,7 +61,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed query is in */;
# cleanup for the sub-case
-system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
drop table t1,t2;
diff --git a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
new file mode 100644
index 00000000000..0be097c78ed
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_mixed.inc
+-- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test
index bf84eed6ec1..c8136d669e4 100644
--- a/mysql-test/suite/binlog/t/binlog_multi_engine.test
+++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test
@@ -69,9 +69,6 @@ UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-error ER_BINLOG_LOGGING_IMPOSSIBLE;
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1n;
@@ -83,13 +80,11 @@ RESET MASTER;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-error ER_BINLOG_LOGGING_IMPOSSIBLE;
+
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
error ER_BINLOG_LOGGING_IMPOSSIBLE;
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-error ER_BINLOG_LOGGING_IMPOSSIBLE;
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
# Not possible to test this since NDB writes its own binlog, which
diff --git a/mysql-test/suite/binlog/t/binlog_start_comment.test b/mysql-test/suite/binlog/t/binlog_start_comment.test
index a5817eb69b7..6f8540efd07 100644
--- a/mysql-test/suite/binlog/t/binlog_start_comment.test
+++ b/mysql-test/suite/binlog/t/binlog_start_comment.test
@@ -21,4 +21,4 @@ select * from t2;
# clean up
drop table t1,t2;
-#--system rm $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
+#--remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
diff --git a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
index a08039c4a41..c6017246e6d 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
@@ -1,5 +1,5 @@
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
--- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_binlog_format_statement.inc
-- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test
new file mode 100644
index 00000000000..4944e65c9f3
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_row.test
@@ -0,0 +1,107 @@
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row_or_statement.inc
+
+# Get rid of previous tests binlog
+--disable_query_log
+reset master;
+--enable_query_log
+
+#
+# Bug#34306: Can't make copy of log tables when server binary log is enabled
+#
+# This is an additional test for Bug#34306 in order to ensure that INSERT INTO
+# .. SELECT FROM is properly replicated under SBR and RBR and that the proper
+# read lock type are acquired.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+SET GLOBAL BINLOG_FORMAT = STATEMENT;
+SET SESSION BINLOG_FORMAT = STATEMENT;
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 LIKE t1;
+select @@SESSION.BINLOG_FORMAT;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(2);
+
+--connect(con1,localhost,root,,)
+--connect(con2,localhost,root,,)
+
+--echo #
+--echo # Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
+--echo # lock that will prevent the source table from being modified.
+--echo #
+
+--connection con1
+--echo # con1
+SELECT GET_LOCK('Bug#34306', 120);
+--connection con2
+--echo # con2
+PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+--send EXECUTE stmt;
+--connection default
+--echo # default
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
+ state = "User lock" AND
+ info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+--source include/wait_condition.inc
+--send INSERT INTO t2 VALUES (3);
+--connection con1
+--echo # con1
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
+ state = "Locked" and info = "INSERT INTO t2 VALUES (3)";
+--source include/wait_condition.inc
+SELECT RELEASE_LOCK('Bug#34306');
+--connection con2
+--echo # con2
+--reap
+SELECT RELEASE_LOCK('Bug#34306');
+--connection default
+--echo # default
+--reap
+
+--echo #
+--echo # Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
+--echo # not prevent the source table from being modified if under RBR.
+--echo #
+
+--connection con2
+--echo # con2
+SET SESSION BINLOG_FORMAT = ROW;
+--connection con1
+--echo # con1
+SELECT GET_LOCK('Bug#34306', 120);
+--connection con2
+--echo # con2
+--send EXECUTE stmt;
+--connection default
+--echo # default
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
+ state = "User lock" AND
+ info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+--source include/wait_condition.inc
+--connection con1
+--echo # con1
+INSERT INTO t2 VALUES (4);
+SELECT RELEASE_LOCK('Bug#34306');
+--connection con2
+--echo # con2
+--reap
+
+--disconnect con1
+--disconnect con2
+--connection default
+--echo # default
+
+--echo # Show binlog events
+source include/show_binlog_events.inc;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index c1813a1add2..84daef5f8da 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -67,7 +67,7 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
-NULL information_schema EVENTS SQL_MODE 12 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -277,12 +277,12 @@ NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL
NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -412,7 +412,7 @@ NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(
NULL information_schema EVENTS EXECUTE_AT datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS INTERVAL_VALUE varchar 256 768 utf8 utf8_general_ci varchar(256)
3.0000 information_schema EVENTS INTERVAL_FIELD varchar 18 54 utf8 utf8_general_ci varchar(18)
-1.0000 information_schema EVENTS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema EVENTS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
NULL information_schema EVENTS STARTS datetime NULL NULL NULL NULL datetime
NULL information_schema EVENTS ENDS datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS STATUS varchar 18 54 utf8 utf8_general_ci varchar(18)
@@ -635,8 +635,8 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
-1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
-1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
+3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result
index 7f7daebf8ee..69ff40b304e 100644
--- a/mysql-test/suite/funcs_1/r/is_events.result
+++ b/mysql-test/suite/funcs_1/r/is_events.result
@@ -39,7 +39,7 @@ EVENT_TYPE varchar(9) NO
EXECUTE_AT datetime YES NULL
INTERVAL_VALUE varchar(256) YES NULL
INTERVAL_FIELD varchar(18) YES NULL
-SQL_MODE longtext NO NULL
+SQL_MODE varchar(8192) NO
STARTS datetime YES NULL
ENDS datetime YES NULL
STATUS varchar(18) NO
@@ -66,7 +66,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` (
`EXECUTE_AT` datetime DEFAULT NULL,
`INTERVAL_VALUE` varchar(256) DEFAULT NULL,
`INTERVAL_FIELD` varchar(18) DEFAULT NULL,
- `SQL_MODE` longtext NOT NULL,
+ `SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`STARTS` datetime DEFAULT NULL,
`ENDS` datetime DEFAULT NULL,
`STATUS` varchar(18) NOT NULL DEFAULT '',
@@ -93,7 +93,7 @@ EVENT_TYPE varchar(9) NO
EXECUTE_AT datetime YES NULL
INTERVAL_VALUE varchar(256) YES NULL
INTERVAL_FIELD varchar(18) YES NULL
-SQL_MODE longtext NO NULL
+SQL_MODE varchar(8192) NO
STARTS datetime YES NULL
ENDS datetime YES NULL
STATUS varchar(18) NO
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index 2f96c08a6ae..5940e900a37 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -45,8 +45,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
-SQL_MODE longtext NO NULL
-DEFINER longtext NO NULL
+SQL_MODE varchar(8192) NO
+DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
@@ -70,8 +70,8 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL DEFAULT '',
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL,
- `SQL_MODE` longtext NOT NULL,
- `DEFINER` longtext NOT NULL,
+ `SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
+ `DEFINER` varchar(77) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
`DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
@@ -95,8 +95,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
-SQL_MODE longtext NO NULL
-DEFINER longtext NO NULL
+SQL_MODE varchar(8192) NO
+DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc.result b/mysql-test/suite/funcs_1/r/memory_storedproc.result
deleted file mode 100644
index 47e8ab24a01..00000000000
--- a/mysql-test/suite/funcs_1/r/memory_storedproc.result
+++ /dev/null
@@ -1,23608 +0,0 @@
-SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
-
-Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
-FUNCTION, ALTER PROCEDURE, ALTER FUNCTION, DROP PROCEDURE, DROP FUNCTION, SHOW
-CREATE PROCEDURE, SHOW CREATE FUNCTION, SHOW CREATE PROCEDURE STATUS, SHOW
-CREATE FUNCTION STATUS, and CALL statements:
---------------------------------------------------------------------------------
-
-Testcase 4.1.1:
----------------
-Ensure that all clauses that should be supported are supported
-CREATE PROCEDURE
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934 (f1 char(20) )
-SELECT * from t1 where f2 = f1;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934('aaaa');
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 tinytext ) language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1, @v1;
-END//
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 binary ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-3
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 blob ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-34
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 int ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-34
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 decimal(256, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-ERROR 42000: Too big precision 256 specified for column ''. Maximum is 65.
-DROP PROCEDURE IF EXISTS sp1//
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(66, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-ERROR 42000: Too big precision 66 specified for column ''. Maximum is 65.
-DROP PROCEDURE IF EXISTS sp1//
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(60, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 17976931340000 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.797693134e+13 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.7976931348623157493578e+308 );
-ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing
-CALL sp1( 0.1234567890987654321e+100 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-100 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+99 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-99 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+98 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-98 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+97 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-97 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+96 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-96 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+95 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-95 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+94 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-94 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+93 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-93 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+92 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-92 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+91 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-91 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+90 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-90 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+89 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-89 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+88 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-88 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+87 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-87 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+86 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-86 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+85 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-85 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+84 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-84 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+83 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-83 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+82 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-82 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+81 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-81 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+80 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-80 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+79 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-79 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+78 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-78 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+77 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-77 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+76 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-76 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+75 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-75 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+74 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-74 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+73 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-73 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+72 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-72 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+71 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-71 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+70 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-70 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+69 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-69 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+68 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-68 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+67 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-67 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+66 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-66 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+65 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-65 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+64 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-64 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+63 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-63 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+62 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-62 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+61 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-61 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+60 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-60 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+59 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-59 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+58 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-58 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+57 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-57 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+56 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-56 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+55 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-55 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+54 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-54 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+53 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-53 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+52 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-52 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+51 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-51 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+50 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-50 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+49 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-49 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+48 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-48 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+47 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-47 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+46 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-46 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+45 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-45 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+44 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-44 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+43 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-43 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+42 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-42 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+41 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-41 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+40 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-40 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+39 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-39 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+38 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-38 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+37 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-37 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+36 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-36 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+35 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-35 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+34 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-34 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+33 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-33 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+32 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-32 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+31 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-31 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+30 );
-@v1
-123456789098765400000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-30 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+29 );
-@v1
-12345678909876540000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-29 );
-@v1
-0.000000000000000000000000000001
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+28 );
-@v1
-1234567890987654000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-28 );
-@v1
-0.000000000000000000000000000012
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+27 );
-@v1
-123456789098765400000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-27 );
-@v1
-0.000000000000000000000000000123
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+26 );
-@v1
-12345678909876540000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-26 );
-@v1
-0.000000000000000000000000001235
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+25 );
-@v1
-1234567890987654000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-25 );
-@v1
-0.000000000000000000000000012346
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+24 );
-@v1
-123456789098765400000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-24 );
-@v1
-0.000000000000000000000000123457
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+23 );
-@v1
-12345678909876540000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-23 );
-@v1
-0.000000000000000000000001234568
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+22 );
-@v1
-1234567890987654000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-22 );
-@v1
-0.000000000000000000000012345679
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+21 );
-@v1
-123456789098765400000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-21 );
-@v1
-0.000000000000000000000123456789
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+20 );
-@v1
-12345678909876540000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-20 );
-@v1
-0.000000000000000000001234567891
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+19 );
-@v1
-1234567890987654000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-19 );
-@v1
-0.000000000000000000012345678910
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+18 );
-@v1
-123456789098765400.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-18 );
-@v1
-0.000000000000000000123456789099
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+17 );
-@v1
-12345678909876540.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-17 );
-@v1
-0.000000000000000001234567890988
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+16 );
-@v1
-1234567890987654.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-16 );
-@v1
-0.000000000000000012345678909877
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+15 );
-@v1
-123456789098765.400000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-15 );
-@v1
-0.000000000000000123456789098765
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+14 );
-@v1
-12345678909876.540000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-14 );
-@v1
-0.000000000000001234567890987654
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+13 );
-@v1
-1234567890987.654000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-13 );
-@v1
-0.000000000000012345678909876540
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+12 );
-@v1
-123456789098.765400000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-12 );
-@v1
-0.000000000000123456789098765400
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+11 );
-@v1
-12345678909.876540000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-11 );
-@v1
-0.000000000001234567890987654000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+10 );
-@v1
-1234567890.987654000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-10 );
-@v1
-0.000000000012345678909876540000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+9 );
-@v1
-123456789.098765400000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-9 );
-@v1
-0.000000000123456789098765400000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+8 );
-@v1
-12345678.909876540000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-8 );
-@v1
-0.000000001234567890987654000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+7 );
-@v1
-1234567.890987654000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-7 );
-@v1
-0.000000012345678909876540000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+6 );
-@v1
-123456.789098765400000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-6 );
-@v1
-0.000000123456789098765400000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+5 );
-@v1
-12345.678909876540000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-5 );
-@v1
-0.000001234567890987654000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+4 );
-@v1
-1234.567890987654000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-4 );
-@v1
-0.000012345678909876550000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+3 );
-@v1
-123.456789098765400000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-3 );
-@v1
-0.000123456789098765400000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+2 );
-@v1
-12.345678909876540000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-2 );
-@v1
-0.001234567890987654000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+1 );
-@v1
-1.234567890987654000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-1 );
-@v1
-0.012345678909876540000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+0 );
-@v1
-0.123456789098765400000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-0 );
-@v1
-0.123456789098765400000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-CALL sp1( "value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 set("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-CALL sp1( "value1, value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-CALL sp1( "value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) language sql SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) deterministic SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) not deterministic SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security definer SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security invoker SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) comment 'this is simple' SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-DROP PROCEDURE sp1;
-
-Testcase 4.1.2:
----------------
-Ensure that all clauses that should be supported are supported
-CREATE FUNCTION
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
-SELECT fn1('world');
-fn1('world')
-hello, world!
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 mediumtext ) returns mediumtext language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = 'hello';
-set f1 = concat( @v1, f1 );
-return f1;
-END//
-SELECT fn1( ' world');
-fn1( ' world')
-hello world
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 decimal(63, 31) ) returns decimal(63, 31) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1000000 + f1;
-return f1;
-END//
-ERROR 42000: Too big scale 31 specified for column ''. Maximum is 30.
-SELECT fn1( 1.3326e+8 );
-ERROR 42000: FUNCTION db_storedproc.fn1 does not exist
-CREATE FUNCTION fn1( f1 decimal(63, 30) ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1000000 + f1;
-return f1;
-END//
-SELECT fn1( 1.3326e+8 );
-fn1( 1.3326e+8 )
-134260000.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 enum("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SELECT fn1( "value1" );
-fn1( "value1" )
-1.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 set("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-SELECT fn1( "value1, value1" );
-fn1( "value1, value1" )
-1.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint deterministic
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint not deterministic
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security definer
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security invoker
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-comment 'this is simple'
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.1.3:
----------------
-Ensure that all clauses that should be supported are supported
-SHOW CREATE PROC
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (f1 char(20) )
-SELECT * from t1 where f2 = f1;
-show CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(f1 char(20) )
-SELECT * from t1 where f2 = f1 latin1 modified created
-DROP PROCEDURE sp1;
-
-Testcase 4.1.4:
----------------
-show create function
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
-show CREATE FUNCTION fn1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(s char(20)) RETURNS char(50) CHARSET latin1
-return concat('hello, ', s, '!') latin1 modified created
-DROP FUNCTION fn1;
-
-Testcase 4.1.5:
----------------
-SHOW PROCEDURE status
---------------------------------------------------------------------------------
-CREATE PROCEDURE sp5()
-SELECT * from t1;
-SHOW PROCEDURE status like 'sp5';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp5 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp5;
-
-Testcase 4.1.6:
----------------
-show function status
---------------------------------------------------------------------------------
-CREATE FUNCTION fn5(a int) returns int
-BEGIN
-set @b = 0.9 * a;
-return @b;
-END//
-SHOW FUNCTION STATUS LIKE 'fn5';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn5 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn5;
-
-Testcase 4.1.7:
----------------
-CALL procedure
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7a;
-DROP PROCEDURE IF EXISTS sp7b;
-DROP PROCEDURE IF EXISTS sp7c;
-CREATE PROCEDURE sp7a(a char(20))
-SELECT * from t1 where t1.f2 = a;
-CALL sp7a( 'xyz' );
-f1 f2 f3 f4 f5 f6
-CREATE PROCEDURE sp7b (a char (20), out b char(20))
-SELECT f1 into b from t1 where t1.f2= a;
-CALL sp7b('xyz', @out_param);
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
-SELECT @out_param;
-@out_param
-NULL
-CREATE PROCEDURE sp7c (a char (20), out b char(20), inout c int)
-BEGIN
-SELECT f1 into b from t1 where t1.f2=a;
-update t1 set t1.f2=999 where t1.f4=c;
-SELECT f2 into c from t1 where t1.f2=999;
-END//
-set @c=1;
-CALL sp7c('xyz', @out_param, @c);
-SELECT @out_param;
-@out_param
-NULL
-SELECT @c;
-@c
-1
-DROP PROCEDURE sp7a;
-DROP PROCEDURE sp7b;
-DROP PROCEDURE sp7c;
-
-Testcase 4.1.8:
----------------
-calling function
---------------------------------------------------------------------------------
-CREATE FUNCTION fn8(a char(20)) returns char(50)
-return concat('hello, ', a, '!');
-SELECT fn8('world');
-fn8('world')
-hello, world!
-DROP FUNCTION fn8;
-
-Testcase 4.1.9:
----------------
-drop procedure
---------------------------------------------------------------------------------
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-DROP PROCEDURE IF EXISTS sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE PROCEDURE sp9()SELECT * from t1;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
-DROP PROCEDURE sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE PROCEDURE sp9()SELECT * from t1;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
-DROP PROCEDURE IF EXISTS sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.1.10:
-----------------
-DROP FUNCTION
---------------------------------------------------------------------------------
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-DROP FUNCTION IF EXISTS fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE FUNCTION fn10() returns int return 100;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci return 100
-DROP FUNCTION fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE FUNCTION fn10() returns int return 100;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci return 100
-DROP FUNCTION IF EXISTS fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.1.11:
-----------------
-alter proc
---------------------------------------------------------------------------------
-create user 'user_1'@'localhost';
-grant execute on db_storedproc.* to 'user_1'@'localhost';
-flush privileges;
-drop table IF EXISTS mysql.t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table mysql.t1( f1 char );
-DROP PROCEDURE IF EXISTS sp11;
-Warnings:
-Note 1305 PROCEDURE sp11 does not exist
-CREATE PROCEDURE sp11() insert into mysql.t1 values('a');
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-DEFINER
-connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
-
-user_1@localhost db_storedproc
-CALL sp11();
-USE db_storedproc;
-
-root@localhost db_storedproc
-alter procedure sp11 sql security invoker;
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-INVOKER
-
-user_1@localhost db_storedproc
-USE db_storedproc;
-CALL sp11();
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't1'
-commit work;
-
-root@localhost db_storedproc
-alter procedure sp11 sql security definer;
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-DEFINER
-CALL sp11();
-DROP USER 'user_1'@'localhost';
-DROP PROCEDURE sp11;
-drop table mysql.t1;
-
-Testcase 4.1.12:
-----------------
-alter function
---------------------------------------------------------------------------------
-CREATE FUNCTION fn12() returns int
-return 100;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-DEFINER
-SELECT fn12();
-fn12()
-100
-alter function fn12 sql security invoker;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-INVOKER
-SELECT fn12();
-fn12()
-100
-alter function fn12 sql security definer;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-DEFINER
-SELECT fn12();
-fn12()
-100
-DROP FUNCTION fn12;
-
-Testcase 4.1.13:
-----------------
-alter proc
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp11;
-Warnings:
-Note 1305 PROCEDURE sp11 does not exist
-CREATE PROCEDURE sp11()
-SELECT * from t1;
-SELECT comment from mysql.proc where specific_name='sp11';
-comment
-
-alter procedure sp11 comment 'this is simple';
-SELECT comment from mysql.proc where specific_name='sp11';
-comment
-this is simple
-DROP PROCEDURE sp11;
-
-Testcase 4.1.14:
-----------------
-alter function
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn12;
-Warnings:
-Note 1305 FUNCTION fn12 does not exist
-CREATE FUNCTION fn12() returns int
-return 100;
-SELECT comment from mysql.proc where specific_name='fn12';
-comment
-
-alter function fn12 comment 'this is simple';
-SELECT comment from mysql.proc where specific_name='fn12';
-comment
-this is simple
-DROP FUNCTION fn12;
-
-Testcase 4.1.15:
-----------------
-Ensure that any invalid stored procedure name is never accepted, and that an
-appropriate error message is returned when the name is rejected
---------------------------------------------------------------------------------
-CREATE PROCEDURE sp1()
-DROP PROCEDURE sp1;
-ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
-CREATE PROCEDURE !_sp1( f1 char(20) )
-SELECT * from t1 where f2 = f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_sp1( f1 char(20) )
-SELECT * from t1 where f2 = f1' at line 1
-CREATE PROCEDURE function()
-SELECT * from t1 where f2=f1;
-DROP PROCEDURE function;
-CREATE PROCEDURE accessible()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE add()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE all()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE alter()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE analyze()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE and()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE as()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE asc()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE asensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE before()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE between()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE bigint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE binary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE blob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE both()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE by()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE call()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cascade()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE case()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE change()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE char()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE character()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE check()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE collate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE column()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE condition()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE constraint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE continue()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE convert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE create()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cross()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_date()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_time()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_timestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_user()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cursor()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE database()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE databases()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_hour()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_minute()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE dec()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE decimal()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE declare()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE default()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE delayed()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE delete()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE desc()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE describe()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE deterministic()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE distinct()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE distinctrow()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE div()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE double()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE drop()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE dual()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE each()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE else()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE elseif()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE enclosed()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE escaped()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE exists()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE exit()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE explain()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE false()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fetch()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fields()
-SELECT * from t1 where f2=f1;
-DROP PROCEDURE fields;
-CREATE PROCEDURE float()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE for()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE force()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE foreign()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE from()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fulltext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE grant()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE group()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE having()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE high_priority()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_minute()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE if()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE ignore()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE in()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE index()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE infile()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE inner()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE inout()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE insensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE insert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int1()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int2()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int3()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int4()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int8()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE integer()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE interval()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE into()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE is()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE iterate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE join()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE key()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE keys()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE kill()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE leading()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE leave()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE left()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE like()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE limit()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE linear()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE lines()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE load()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE localtime()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE localtimestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE lock()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE long()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE longblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE longtext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE loop()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE low_priority()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE master_ssl_verify_server_cert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE match()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumtext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE middleint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE minute_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE minute_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mod()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE modifies()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE natural()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE not()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE no_write_to_binlog()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE null()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE numeric()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE on()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE optimize()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE option()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE optionally()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE or()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE order()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE out()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE outer()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE outfile()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE precision()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE primary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE procedure()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE purge()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE range()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE read()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE reads()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE real()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE references()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE regexp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE release()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE rename()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE repeat()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE replace()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE require()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE restrict()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE return()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE revoke()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE right()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE rlike()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE schema()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE schemas()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE second_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE select()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE separator()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE set()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE show()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE smallint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE spatial()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE specific()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlexception()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlstate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlwarning()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_big_result()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_calc_found_rows()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_small_result()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE ssl()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE starting()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE straight_join()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE table()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE terminated()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE then()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinyblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinyint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinytext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE to()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE trailing()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE trigger()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE true()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE undo()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE union()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unique()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unlock()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unsigned()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE update()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE usage()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE use()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE using()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_date()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_time()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_timestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE values()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varbinary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varchar()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varcharacter()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varying()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE when()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE where()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE while()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE with()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE write()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE xor()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE year_month()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE zerofill()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill()
-SELECT * from t1 where f2=f1' at line 1
-
-Testcase 4.1.15:
-----------------
-Ensure that any invalid function name is never accepted, and that an appropriate
-error message is returned when the name is rejected
---------------------------------------------------------------------------------
-CREATE FUNCTION !_fn1(f1 char) returns char
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_fn1(f1 char) returns char
-return f1' at line 1
-CREATE FUNCTION char(f1 char) returns char
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char(f1 char) returns char
-return f1' at line 1
-CREATE FUNCTION char binary(f1 char binary) returns char binary
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary(f1 char binary) returns char binary
-return f1' at line 1
-CREATE FUNCTION char ascii(f1 char ascii) returns char ascii
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii(f1 char ascii) returns char ascii
-return f1' at line 1
-CREATE FUNCTION char not null(f1 char not null) returns char not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char not null(f1 char not null) returns char not null
-return f1' at line 1
-CREATE FUNCTION char binary not null(f1 char binary not null) returns char binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary not null(f1 char binary not null) returns char binary not null
-retur' at line 1
-CREATE FUNCTION char ascii not null(f1 char ascii not null) returns char ascii not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii not null(f1 char ascii not null) returns char ascii not null
-return f' at line 1
-CREATE FUNCTION tinytext(f1 tinytext) returns tinytext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext(f1 tinytext) returns tinytext
-return f1' at line 1
-CREATE FUNCTION text(f1 text) returns text
-return f1;
-DROP FUNCTION text;
-CREATE FUNCTION mediumtext(f1 mediumtext) returns mediumtext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext(f1 mediumtext) returns mediumtext
-return f1' at line 1
-CREATE FUNCTION longtext(f1 longtext) returns longtext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext(f1 longtext) returns longtext
-return f1' at line 1
-CREATE FUNCTION tinytext not null(f1 tinytext not null) returns tinytext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext not null(f1 tinytext not null) returns tinytext not null
-return f1' at line 1
-CREATE FUNCTION text not null(f1 text not null) returns text not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null(f1 text not null) returns text not null
-return f1' at line 1
-CREATE FUNCTION mediumtext not null(f1 mediumtext not null) returns mediumtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext not null(f1 mediumtext not null) returns mediumtext not null
-return f' at line 1
-CREATE FUNCTION longtext not null(f1 longtext not null) returns longtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext not null(f1 longtext not null) returns longtext not null
-return f1' at line 1
-CREATE FUNCTION tinyblob(f1 tinyblob) returns tinyblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob(f1 tinyblob) returns tinyblob
-return f1' at line 1
-CREATE FUNCTION blob(f1 blob) returns blob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob(f1 blob) returns blob
-return f1' at line 1
-CREATE FUNCTION mediumblob(f1 mediumblob) returns mediumblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob(f1 mediumblob) returns mediumblob
-return f1' at line 1
-CREATE FUNCTION longblob(f1 longblob) returns longblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob(f1 longblob) returns longblob
-return f1' at line 1
-CREATE FUNCTION tinyblob not null(f1 tinyblob not null) returns tinyblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob not null(f1 tinyblob not null) returns tinyblob not null
-return f1' at line 1
-CREATE FUNCTION blob not null(f1 blob not null) returns blob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob not null(f1 blob not null) returns blob not null
-return f1' at line 1
-CREATE FUNCTION mediumblob not null(f1 mediumblob not null) returns mediumblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob not null(f1 mediumblob not null) returns mediumblob not null
-return f' at line 1
-CREATE FUNCTION longblob not null(f1 longblob not null) returns longblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob not null(f1 longblob not null) returns longblob not null
-return f1' at line 1
-CREATE FUNCTION binary(f1 binary) returns binary
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary(f1 binary) returns binary
-return f1' at line 1
-CREATE FUNCTION binary not null(f1 binary not null) returns binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary not null(f1 binary not null) returns binary not null
-return f1' at line 1
-CREATE FUNCTION tinyint(f1 tinyint) returns tinyint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint(f1 tinyint) returns tinyint
-return f1' at line 1
-CREATE FUNCTION tinyint unsigned(f1 tinyint unsigned) returns tinyint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned(f1 tinyint unsigned) returns tinyint unsigned
-return f1' at line 1
-CREATE FUNCTION tinyint zerofill(f1 tinyint zerofill) returns tinyint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint zerofill(f1 tinyint zerofill) returns tinyint zerofill
-return f1' at line 1
-CREATE FUNCTION tinyint unsigned zerofill(f1 tinyint unsigned zerofill) returns tinyint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned zerofill(f1 tinyint unsigned zerofill) returns tinyint unsigned' at line 1
-CREATE FUNCTION smallint(f1 smallint) returns smallint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint(f1 smallint) returns smallint
-return f1' at line 1
-CREATE FUNCTION smallint unsigned(f1 smallint unsigned) returns smallint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned(f1 smallint unsigned) returns smallint unsigned
-return f1' at line 1
-CREATE FUNCTION smallint zerofill(f1 smallint zerofill) returns smallint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint zerofill(f1 smallint zerofill) returns smallint zerofill
-return f1' at line 1
-CREATE FUNCTION smallint unsigned zerofill(f1 smallint unsigned zerofill) returns smallint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned zerofill(f1 smallint unsigned zerofill) returns smallint unsig' at line 1
-CREATE FUNCTION mediumint(f1 mediumint) returns mediumint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint(f1 mediumint) returns mediumint
-return f1' at line 1
-CREATE FUNCTION mediumint unsigned(f1 mediumint unsigned) returns mediumint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned(f1 mediumint unsigned) returns mediumint unsigned
-return f1' at line 1
-CREATE FUNCTION mediumint zerofill(f1 mediumint zerofill) returns mediumint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint zerofill(f1 mediumint zerofill) returns mediumint zerofill
-return f1' at line 1
-CREATE FUNCTION mediumint unsigned zerofill(f1 mediumint unsigned zerofill) returns mediumint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned zerofill(f1 mediumint unsigned zerofill) returns mediumint un' at line 1
-CREATE FUNCTION int(f1 int) returns int
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int(f1 int) returns int
-return f1' at line 1
-CREATE FUNCTION int1(f1 int1) returns int1
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1(f1 int1) returns int1
-return f1' at line 1
-CREATE FUNCTION int2(f1 int2) returns int2
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2(f1 int2) returns int2
-return f1' at line 1
-CREATE FUNCTION int3(f1 int3) returns int3
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3(f1 int3) returns int3
-return f1' at line 1
-CREATE FUNCTION int4(f1 int4) returns int4
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4(f1 int4) returns int4
-return f1' at line 1
-CREATE FUNCTION int8(f1 int8) returns int8
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8(f1 int8) returns int8
-return f1' at line 1
-CREATE FUNCTION int unsigned(f1 int unsigned) returns int unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned(f1 int unsigned) returns int unsigned
-return f1' at line 1
-CREATE FUNCTION int zerofill(f1 int zerofill) returns int zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int zerofill(f1 int zerofill) returns int zerofill
-return f1' at line 1
-CREATE FUNCTION int unsigned zerofill(f1 int unsigned zerofill) returns int unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned zerofill(f1 int unsigned zerofill) returns int unsigned zerofill
-re' at line 1
-CREATE FUNCTION bigint(f1 bigint) returns bigint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint(f1 bigint) returns bigint
-return f1' at line 1
-CREATE FUNCTION bigint unsigned(f1 bigint unsigned) returns bigint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned(f1 bigint unsigned) returns bigint unsigned
-return f1' at line 1
-CREATE FUNCTION bigint zerofill(f1 bigint zerofill) returns bigint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint zerofill(f1 bigint zerofill) returns bigint zerofill
-return f1' at line 1
-CREATE FUNCTION bigint unsigned zerofill(f1 bigint unsigned zerofill) returns bigint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned zerofill(f1 bigint unsigned zerofill) returns bigint unsigned ze' at line 1
-CREATE FUNCTION decimal(f1 decimal) returns decimal
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal(f1 decimal) returns decimal
-return f1' at line 1
-CREATE FUNCTION decimal unsigned(f1 decimal unsigned) returns decimal unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned(f1 decimal unsigned) returns decimal unsigned
-return f1' at line 1
-CREATE FUNCTION decimal zerofill(f1 decimal zerofill) returns decimal zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal zerofill(f1 decimal zerofill) returns decimal zerofill
-return f1' at line 1
-CREATE FUNCTION decimal unsigned zerofill(f1 decimal unsigned zerofill) returns decimal unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned zerofill(f1 decimal unsigned zerofill) returns decimal unsigned' at line 1
-CREATE FUNCTION numeric(f1 numeric) returns numeric
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric(f1 numeric) returns numeric
-return f1' at line 1
-CREATE FUNCTION numeric unsigned(f1 numeric unsigned) returns numeric unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned(f1 numeric unsigned) returns numeric unsigned
-return f1' at line 1
-CREATE FUNCTION numeric zerofill(f1 numeric zerofill) returns numeric zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric zerofill(f1 numeric zerofill) returns numeric zerofill
-return f1' at line 1
-CREATE FUNCTION numeric unsigned zerofill(f1 numeric unsigned zerofill) returns numeric unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned zerofill(f1 numeric unsigned zerofill) returns numeric unsigned' at line 1
-CREATE FUNCTION real(f1 real) returns real
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real(f1 real) returns real
-return f1' at line 1
-CREATE FUNCTION real unsigned(f1 real unsigned) returns real unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned(f1 real unsigned) returns real unsigned
-return f1' at line 1
-CREATE FUNCTION real zerofill(f1 real zerofill) returns real zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real zerofill(f1 real zerofill) returns real zerofill
-return f1' at line 1
-CREATE FUNCTION real unsigned zerofill(f1 real unsigned zerofill) returns real unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned zerofill(f1 real unsigned zerofill) returns real unsigned zerofill' at line 1
-CREATE FUNCTION float(f1 float) returns float
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(f1 float) returns float
-return f1' at line 1
-CREATE FUNCTION float unsigned(f1 float unsigned) returns float unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned(f1 float unsigned) returns float unsigned
-return f1' at line 1
-CREATE FUNCTION float zerofill(f1 float zerofill) returns float zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float zerofill(f1 float zerofill) returns float zerofill
-return f1' at line 1
-CREATE FUNCTION float unsigned zerofill(f1 float unsigned zerofill) returns float unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned zerofill(f1 float unsigned zerofill) returns float unsigned zerof' at line 1
-CREATE FUNCTION date(f1 date) returns date
-return f1;
-DROP FUNCTION date;
-CREATE FUNCTION time(f1 time) returns time
-return f1;
-DROP FUNCTION time;
-CREATE FUNCTION datetime(f1 datetime) returns datetime
-return f1;
-DROP FUNCTION datetime;
-CREATE FUNCTION timestamp(f1 timestamp) returns timestamp
-return f1;
-DROP FUNCTION timestamp;
-CREATE FUNCTION year(f1 year) returns year
-return f1;
-DROP FUNCTION year;
-CREATE FUNCTION year(3)(f1 year(3)) returns year(3)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3)(f1 year(3)) returns year(3)
-return f1' at line 1
-CREATE FUNCTION year(4)(f1 year(4)) returns year(4)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4)(f1 year(4)) returns year(4)
-return f1' at line 1
-CREATE FUNCTION enum("1enum", "2enum")(f1 enum("1enum", "2enum")) returns enum("1enum", "2enum")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"1enum", "2enum")(f1 enum("1enum", "2enum")) returns enum("1enum", "2enum")
-retu' at line 1
-CREATE FUNCTION set("1set", "2set")(f1 set("1set", "2set")) returns set("1set", "2set")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set("1set", "2set")(f1 set("1set", "2set")) returns set("1set", "2set")
-return f' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ) returns char
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 char binary ) returns char binary
-return f1;
-ERROR 42000: This version of MySQL doesn't yet support 'return value collation'
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ascii ) returns char ascii
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 char not null ) returns char not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char binary not null ) returns char binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char binary not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ascii not null ) returns char ascii not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char ascii not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinytext ) returns tinytext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 text ) returns text
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumtext ) returns mediumtext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 longtext ) returns longtext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinytext not null ) returns tinytext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns tinytext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 text not null ) returns text not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns text not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 mediumtext not null ) returns mediumtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns mediumtext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 longtext not null ) returns longtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns longtext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinyblob ) returns tinyblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 blob ) returns blob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumblob ) returns mediumblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 longblob ) returns longblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyblob not null ) returns tinyblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns tinyblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 blob not null ) returns blob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns blob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 mediumblob not null ) returns mediumblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns mediumblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 longblob not null ) returns longblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns longblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 binary ) returns binary
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 binary not null ) returns binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns binary not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinyint ) returns tinyint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint unsigned ) returns tinyint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint zerofill ) returns tinyint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint unsigned zerofill ) returns tinyint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint ) returns smallint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint unsigned ) returns smallint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint zerofill ) returns smallint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint unsigned zerofill ) returns smallint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint ) returns mediumint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint unsigned ) returns mediumint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint zerofill ) returns mediumint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint unsigned zerofill ) returns mediumint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int ) returns int
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int unsigned ) returns int unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int1 unsigned ) returns int1 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int2 unsigned ) returns int2 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int3 unsigned ) returns int3 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int4 unsigned ) returns int4 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int8 unsigned ) returns int8 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int zerofill ) returns int zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int unsigned zerofill ) returns int unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint ) returns bigint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint unsigned ) returns bigint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint zerofill ) returns bigint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint unsigned zerofill ) returns bigint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal ) returns decimal
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal unsigned ) returns decimal unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal zerofill ) returns decimal zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal unsigned zerofill ) returns decimal unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric ) returns numeric
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric unsigned ) returns numeric unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric zerofill ) returns numeric zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric unsigned zerofill ) returns numeric unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real ) returns real
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real unsigned ) returns real unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real zerofill ) returns real zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real unsigned zerofill ) returns real unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float ) returns float
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float unsigned ) returns float unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float zerofill ) returns float zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float unsigned zerofill ) returns float unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 date ) returns date
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 time ) returns time
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 datetime ) returns datetime
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 timestamp ) returns timestamp
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 year ) returns year
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 year(f1 3) ) returns year(3)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 3) ) returns year(3)
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 year(f1 4) ) returns year(4)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 4) ) returns year(4)
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 enum(f1 "1enum", "2enum") ) returns enum("1enum", "2enum")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 "1enum", "2enum") ) returns enum("1enum", "2enum")
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 set(f1 "1set", "2set") ) returns set("1set", "2set")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 "1set", "2set") ) returns set("1set", "2set")
-return f1' at line 1
-
-Testcase 4.1.16:
-----------------
-Ensure that a reference to a non-existent stored procedure is rejected with an
-appropriate error message
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp16;
-Warnings:
-Note 1305 PROCEDURE sp16 does not exist
-CALL sp16( 'xyz' );
-ERROR 42000: PROCEDURE db_storedproc.sp16 does not exist
-CREATE DATABASE db1;
-USE db1;
-CREATE PROCEDURE sp16()
-BEGIN
-set @var1 = 1;
-SELECT @var1;
-END//
-CALL db_storedproc.sp16();
-ERROR 42000: PROCEDURE db_storedproc.sp16 does not exist
-USE db_storedproc;
-DROP PROCEDURE db1.sp16;
-DROP DATABASE db1;
-
-Testcase 4.1.17:
-----------------
-Ensure that it is possible to drop, create and CALL/execute a procedure and a
-function with the same name, even in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 ()
-BEGIN
-declare x enum( 'db1', 'test' ) default 'test';
-SELECT x;
-END//
-CALL sp1();
-x
-test
-CREATE FUNCTION sp1 (y char) returns char return y;
-SELECT sp1( 'a' );
-sp1( 'a' )
-a
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-USE db1;
-CALL db_storedproc.sp1( );
-x
-test
-SELECT db_storedproc.sp1( 'a' );
-db_storedproc.sp1( 'a' )
-a
-DROP FUNCTION db_storedproc.sp1;
-USE db_storedproc;
-SELECT sp1('a');
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-DROP PROCEDURE sp1;
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-SELECT sp1('a');
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-USE db_storedproc;
-DROP DATABASE db1;
-
-Testcase 4.1.18:
-----------------
-Ensure that it is possible to alter a procedure and
-a function with the same name, in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-set @x=null;
-set @y=null;
-CREATE PROCEDURE sp1()
-BEGIN
-set @x= 1;
-SELECT @x;
-END//
-CREATE FUNCTION sp1 () returns int return 2.2;
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-USE db1;
-alter procedure db_storedproc.sp1 sql security invoker;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION DEFINER
-sp1 PROCEDURE INVOKER
-alter function db_storedproc.sp1 sql security invoker;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION INVOKER
-sp1 PROCEDURE INVOKER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-USE db_storedproc;
-alter procedure sp1 sql security definer;
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-alter function sp1 sql security definer;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION DEFINER
-sp1 PROCEDURE DEFINER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-USE db_storedproc;
-DROP DATABASE db1;
-DROP PROCEDURE db_storedproc.sp1;
-DROP FUNCTION db_storedproc.sp1;
-
-Testcase 4.1.19:
-----------------
-verify altering procedure and function with the same name, does not affect
-properties of a procedure and a function with the same name in the different
-database.
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc_3122;
-CREATE DATABASE db_storedproc_3122;
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-DROP PROCEDURE IF EXISTS db_storedproc_3122.sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS db_storedproc_3122.sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-set @x= 1;
-SELECT @x;
-END//
-CREATE FUNCTION db_storedproc_3122.sp1() returns double return 2.2;
-CALL sp1();
-@x
-1
-SELECT db_storedproc_3122.sp1();
-db_storedproc_3122.sp1()
-2.2
-USE db_storedproc_3122;
-CREATE PROCEDURE sp1 ()
-BEGIN
-set @x= 3;
-SELECT @x;
-END//
-CREATE FUNCTION db_storedproc.sp1() returns double return 4.4;
-CALL sp1();
-@x
-3
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-4.4
-alter procedure db_storedproc_3122.sp1 sql security invoker;
-alter function sp1 sql security invoker;
-SELECT db, name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-db name type security_type
-db_storedproc sp1 FUNCTION DEFINER
-db_storedproc sp1 PROCEDURE DEFINER
-db_storedproc_3122 sp1 FUNCTION INVOKER
-db_storedproc_3122 sp1 PROCEDURE INVOKER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-4.4
-CALL db_storedproc_3122.sp1();
-@x
-3
-SELECT db_storedproc_3122.sp1();
-db_storedproc_3122.sp1()
-2.2
-USE db_storedproc;
-DROP DATABASE db_storedproc_3122;
-DROP FUNCTION db_storedproc.sp1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.20:
-----------------
-Ensure that it is possible to alter the comment of a procedure
-and a function with the same name, even in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-DROP PROCEDURE IF EXISTS sp1;
-DROP FUNCTION IF EXISTS sp1;
-CREATE PROCEDURE sp1 () set @x= 1;
-CREATE FUNCTION sp1 () returns int return 2;
-DROP DATABASE IF EXISTS db_storedproc_3122;
-Warnings:
-Note 1008 Can't drop database 'db_storedproc_3122'; database doesn't exist
-CREATE DATABASE db_storedproc_3122;
-USE db_storedproc_3122;
-CREATE PROCEDURE sp1 () set @x= 3;
-CREATE FUNCTION sp1 () returns int return 4;
-alter procedure sp1 sql security invoker comment 'this is a procedure';
-alter function sp1 sql security invoker comment 'this is a function';
-alter procedure sp1 sql security definer;
-alter function sp1 sql security definer;
-show CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
- COMMENT 'this is a procedure'
-set @x= 3 latin1 modified created
-show CREATE FUNCTION sp1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `sp1`() RETURNS int(11)
- COMMENT 'this is a function'
-return 4 latin1 modified created
-USE db_storedproc;
-DROP DATABASE db_storedproc_3122;
-DROP FUNCTION db_storedproc.sp1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.21:
-----------------
-Ensure that it is not possible to create two procedures with same name
-in same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 () set @x=1;
-CREATE PROCEDURE sp1 () set @x=2;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL sp1();
-SELECT @x;
-@x
-1
-USE db1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=3;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL db_storedproc.sp1();
-SELECT @x;
-@x
-1
-DROP PROCEDURE IF EXISTS db_storedproc.sp1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=2;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL db_storedproc.sp1();
-SELECT @x;
-@x
-1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.22:
-----------------
-Ensure that it is not possible to create two functions with same name in the
-same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1 () returns int return 1;
-CREATE FUNCTION fn1 () returns int return 2;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT fn1();
-fn1()
-1
-USE db1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 3;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT db_storedproc.fn1();
-db_storedproc.fn1()
-1
-DROP FUNCTION IF EXISTS db_storedproc.fn1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 2;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT db_storedproc.fn1();
-db_storedproc.fn1()
-1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP FUNCTION db_storedproc.fn1;
-
-Testcase 4.1.23:
-----------------
-Ensure that it is possible to create two or more procedures with the same name,
-providing each resides in different databases
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 () set @x= 1;
-DROP DATABASE IF EXISTS test3124;
-Warnings:
-Note 1008 Can't drop database 'test3124'; database doesn't exist
-CREATE DATABASE test3124;
-USE test3124;
-CREATE PROCEDURE sp1 () set @y= 2;
-CALL sp1();
-SELECT @x, @y;
-@x @y
-NULL 2
-USE db_storedproc;
-CALL sp1();
-SELECT @x, @y;
-@x @y
-1 2
-USE db_storedproc;
-DROP DATABASE test3124;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.24:
-----------------
-Ensure that it is possible to create two or more functions with the same name,
-providing each resides in different databases.
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP FUNCTION IF EXISTS f1;
-Warnings:
-Note 1305 FUNCTION f1 does not exist
-CREATE FUNCTION f1 () returns int return 1;
-DROP DATABASE IF EXISTS test3125;
-Warnings:
-Note 1008 Can't drop database 'test3125'; database doesn't exist
-CREATE DATABASE test3125;
-USE test3125;
-CREATE FUNCTION f1 () returns int return 2;
-SELECT f1();
-f1()
-2
-USE db_storedproc;
-SELECT f1();
-f1()
-1
-USE db_storedproc;
-DROP DATABASE test3125;
-DROP FUNCTION db_storedproc.f1;
-
-Testcase 4.1.25:
-----------------
-Ensure that any invalid function name is never accepted, and that an appropriate
-error message is returned when the name is rejected. (invalid func name)
---------------------------------------------------------------------------------
-CREATE FUNCTION !_fn1( f1 char(20) ) returns int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_fn1( f1 char(20) ) returns int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;' at line 1
-CREATE FUNCTION fn1( f1 char(20) ) return int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END' at line 1
-CREATE FUNCTION fn1() returns int
-return 'a';
-CREATE FUNCTION procedure() returns int
-return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure() returns int
-return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int lang sql return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int deterministic( return 1);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return 1)' at line 1
-CREATE FUNCTION fn1(a char) returns int non deterministic return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int not deterministic comment 'abc' language sql sql security refiner return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'refiner return 1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-
-Testcase 4.1.1:
----------------
-Ensure that all clauses that should be supported are supported.
-CREATE PROCEDURE
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @count = 0;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1(cnt int(20))
-BEGIN
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-END//
-CALL sp1( 10 );
-SELECT @count;
-@count
-10
-DROP PROCEDURE sp1;
-
-Testcase 4.2.2:
-BEGINend
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-BEGIN
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-END//
-CALL sp1( 10 );
-@count
-10
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-END//
-ERROR 42S22: Unknown column 'cnt' in 'field list'
-CALL sp1( 10 );
-DROP PROCEDURE sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-END
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-BEGIN//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-BEGIN' at line 2
-CALL sp1( 10 );
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-BEGIN
-SELECT count(*) into cnt from t2;
-BEGIN
-BEGIN END;
-BEGIN
-END;
-set @count = cnt;
-SELECT @count;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 10
-
-Testcase 4.2.4:
----------------
-Ensure that every BEGIN statement is coupled with a terminating END statement.
-(BEGIN with no END)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-
-Testcase ....:
---------------
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-accessible:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-add:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-all:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-alter:BEGIN
-SELECT @x;
-END//
-ERROR 0A000: ALTER VIEW is not allowed in stored procedures
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-analyze:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-and:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-as:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-asc:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-asensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-before:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-between:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-bigint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-binary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-blob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-both:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-by:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-call:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cascade:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-case:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-change:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-char:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-character:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-check:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-collate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-column:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-condition:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-constraint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-continue:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-convert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-create:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cross:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_date:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_time:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_timestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_user:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cursor:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-database:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-databases:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_hour:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_minute:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-dec:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-decimal:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-declare:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-default:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-delayed:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-delete:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-desc:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-describe:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-deterministic:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-distinct:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-distinctrow:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-div:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-double:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-drop:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-dual:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-each:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-else:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-elseif:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-enclosed:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-escaped:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-exists:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-exit:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-explain:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-false:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-fetch:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float4:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float8:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-for:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-force:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-foreign:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-from:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-fulltext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-grant:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-group:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-having:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-high_priority:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_minute:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-if:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-ignore:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-in:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-index:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-infile:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-inner:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-inout:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-insensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-insert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int1:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int2:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int3:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int4:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int8:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-integer:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-interval:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-into:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-is:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-iterate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-join:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-key:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-keys:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-kill:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-leading:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-leave:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-left:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-like:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-limit:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-linear:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-lines:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-load:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-localtime:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-localtimestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-lock:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-long:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-longblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-longtext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-loop:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-low_priority:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-master_ssl_verify_server_cert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-match:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumtext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-middleint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-minute_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-minute_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mod:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-modifies:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-natural:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-not:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-no_write_to_binlog:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-null:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-numeric:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-on:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-optimize:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-option:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-optionally:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-or:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-order:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-out:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-outer:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-outfile:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-precision:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-primary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-procedure:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-purge:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-range:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-read:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-reads:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-read_write:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-real:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-references:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-regexp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-release:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-rename:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-repeat:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-replace:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-require:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-restrict:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-return:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-revoke:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-right:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-rlike:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-schema:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-schemas:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-second_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-select:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-separator:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-set:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-show:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-smallint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-spatial:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-specific:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlexception:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlstate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlwarning:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_big_result:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_calc_found_rows:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_small_result:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-ssl:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-starting:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-straight_join:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-table:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-terminated:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-then:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinyblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinyint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinytext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-to:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-trailing:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-trigger:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-true:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-undo:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-union:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unique:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unlock:BEGIN
-SELECT @x;
-END//
-ERROR 0A000: UNLOCK is not allowed in stored procedures
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unsigned:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-update:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-usage:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-use:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-using:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_date:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_time:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_timestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-values:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varbinary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varchar:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varcharacter:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varying:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-when:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-where:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-while:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-with:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-write:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-xor:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-year_month:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-zerofill:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill:BEGIN
-SELECT @x;
-END' at line 2
-
-Testcase 4.2.6:
----------------
-Ensure that the labels for multiple BEGIN an END work properly
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char;
-declare y char;
-set x = '1';
-set y = '2';
-label1: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END label1;
-set @v1 = x;
-set @v2 = y;
-SELECT @v1, @v2;
-END begin_label//
-CALL sp1();
-@v1 @v2
-1 2
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE sp1;
-
-Testcase 4.2.7:
----------------
-Ensure that the labels enclosing each BEGIN/END compound statement must match.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin1_label: BEGIN
-declare x char;
-declare y char;
-SELECT lf1, f1 into x, y from t2 limit 1;
-begin2_label: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin2_changed;
-END begin1_changed//
-ERROR 42000: End-label begin2_changed without match
-
-Testcase 4.2.8:
----------------
-Ensure that it is possible to put a beginning label at the start of a
-BEGIN/END compound statement without also requiring an ending label
-at the END of the same statement.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE sp1;
-
-Testcase 4.2.9:
----------------
-Ensure that it is not possible to put an ending label at the END of
-a BEGIN/END compound statement without also requiring a matching
-beginning label at the start of the same statement
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_label//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'begin_label' at line 6
-
-Testcase 4.2.10:
-----------------
-Ensure that every beginning label must END with a colon(:)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_label//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-E' at line 2
-
-Testcase 4.2.11:
-----------------
-Ensure that every beginning label with the same scope must be unique. (same label names)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_samelabel;
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_samelabel;
-END begin_samelabel//
-ERROR 42000: Redefining label begin_samelabel
-
-Testcase 4.2.12:
-----------------
-Ensure that the variables, cursors, conditions, and handlers declared for
-a stored procedure (with the declare statement) may only be properly defined
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x char default 'a';
-declare y integer default 1;
-declare z float default 1.1;
-declare a enum("value1", "value2") default 'value1';
-declare b decimal(255, 255) default 1.2e+12;
-declare c mediumtext default 'mediumtext';
-declare d datetime default '2005-02-02 12:12:12';
-declare e char default 'b';
-declare cur1 cursor for SELECT f1 from db_storedproc.t2;
-declare continue handler for sqlstate '02000' set @x2 = 1;
-open cur1;
-fetch cur1 into e;
-SELECT x, y, z, a, b, c, d, e;
-close cur1;
-END//
-ERROR 42000: Too big scale 255 specified for column ''. Maximum is 30.
-CALL sp6();
-ERROR 42000: PROCEDURE db_storedproc.sp6 does not exist
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 char default '0';
-SELECT x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567;
-END//
-CALL sp6();
-x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
-0
-DROP PROCEDURE sp6;
-
-Testcase 4.2.13:
-----------------
-Ensure that the variables declared for a stored procedure (with the declare
-statement) may only be defined in the correct order.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x default '0' char;
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default '0' char;
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x char, integer default '0';
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' integer default '0';
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x1, x2 char, integer default '0', 1;
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' integer default '0', 1;
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x, y1 integer default 0;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x, y1 integer default 0;
-declare char y;
-SELECT f1, f2 into x, y from t2 li' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x default 'a' char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default 'a' char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition notable for sqlstate '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition notable for sqlstate '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for notable sqlstate '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for notable sqlstate '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for sqlstate notable '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate notable '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for sqlstate '42s22' notable;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '42s22' notable;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor cur1 for SELECT f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor cur1 for SELECT f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor for cur1 SELECT f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor for cur1 SELECT f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor for SELECT cur1 f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor for SELECT cur1 f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler continue for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler exit for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler undo for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x;
-SELECT f1 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x;
-SELECT f1 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char binary x;
-SELECT f2 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary x;
-SELECT f2 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char ascii x;
-SELECT f3 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii x;
-SELECT f3 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext x;
-SELECT f4 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext x;
-SELECT f4 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x;
-SELECT f5 text into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-SELECT f5 text into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext x;
-SELECT f6 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext x;
-SELECT f6 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext x;
-SELECT f7 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext x;
-SELECT f7 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob x;
-SELECT f8 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob x;
-SELECT f8 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob x;
-SELECT f9 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob x;
-SELECT f9 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob x;
-SELECT f10 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob x;
-SELECT f10 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob x;
-SELECT f11 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob x;
-SELECT f11 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary x;
-SELECT f12 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary x;
-SELECT f12 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint x;
-SELECT f13 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint x;
-SELECT f13 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint unsigned x;
-SELECT f14 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned x;
-SELECT f14 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint zerofill x;
-SELECT f15 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint zerofill x;
-SELECT f15 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint unsigned zerofill x;
-SELECT f16 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned zerofill x;
-SELECT f16 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint x;
-SELECT f17 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint x;
-SELECT f17 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint unsigned x;
-SELECT f18 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned x;
-SELECT f18 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint zerofill x;
-SELECT f19 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint zerofill x;
-SELECT f19 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint unsigned zerofill x;
-SELECT f20 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned zerofill x;
-SELECT f20 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint x;
-SELECT f21 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint x;
-SELECT f21 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint unsigned x;
-SELECT f22 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned x;
-SELECT f22 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint zerofill x;
-SELECT f23 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint zerofill x;
-SELECT f23 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint unsigned zerofill x;
-SELECT f24 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned zerofill x;
-SELECT f24 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int x;
-SELECT f25 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int x;
-SELECT f25 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int unsigned x;
-SELECT f26 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned x;
-SELECT f26 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int zerofill x;
-SELECT f27 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int zerofill x;
-SELECT f27 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int unsigned zerofill x;
-SELECT f28 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned zerofill x;
-SELECT f28 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint x;
-SELECT f29 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint x;
-SELECT f29 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint unsigned x;
-elect f30 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned x;
-elect f30 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint zerofill x;
-SELECT f31 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint zerofill x;
-SELECT f31 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint unsigned zerofill x;
-SELECT f32 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned zerofill x;
-SELECT f32 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal x;
-SELECT f33 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal x;
-SELECT f33 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal unsigned x;
-SELECT f34 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned x;
-SELECT f34 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal zerofill x;
-SELECT f35 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal zerofill x;
-SELECT f35 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal unsigned zerofill not null x;
-SELECT f36 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned zerofill not null x;
-SELECT f36 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) not null x;
-SELECT f37 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) not null x;
-SELECT f37 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) not null x;
-SELECT f38 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) not null x;
-SELECT f38 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) unsigned not null x;
-SELECT f39 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) unsigned not null x;
-SELECT f39 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) unsigned not null x;
-SELECT f40 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) unsigned not null x;
-SELECT f40 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) zerofill not null x;
-SELECT f41 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) zerofill not null x;
-SELECT f41 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) zerofill not null x;
-SELECT f42 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) zerofill not null x;
-SELECT f42 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) unsigned zerofill not null x;
-SELECT f43 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) unsigned zerofill not null x;
-SELECT f43 into x from tb1 limit 9998' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) unsigned zerofill not null x;
-SELECT f44 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) unsigned zerofill not null x;
-SELECT f44 into x from tb1 limit 999' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) not null x;
-SELECT f45 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) not null x;
-SELECT f45 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) not null x;
-SELECT f46 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) not null x;
-SELECT f46 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) unsigned not null x;
-SELECT f47 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) unsigned not null x;
-SELECT f47 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) unsigned not null x;
-SELECT f48 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) unsigned not null x;
-SELECT f48 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) zerofill not null x;
-SELECT f49 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) zerofill not null x;
-SELECT f49 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) zerofill not null x;
-SELECT f50 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) zerofill not null x;
-SELECT f50 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) unsigned zerofill not null x;
-SELECT f51 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) unsigned zerofill not null x;
-SELECT f51 into x from tb1 limit 999' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) unsigned zerofill not null x;
-SELECT f52 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) unsigned zerofill not null x;
-SELECT f52 into x from tb1 limit' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric not null x;
-SELECT f53 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric not null x;
-SELECT f53 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric unsigned not null x;
-SELECT f54 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned not null x;
-SELECT f54 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric zerofill not null x;
-SELECT f55 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric zerofill not null x;
-SELECT f55 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric unsigned zerofill not null x;
-SELECT f56 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned zerofill not null x;
-SELECT f56 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) not null x;
-SELECT f57 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) not null x;
-SELECT f57 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) not nul x;
-SELECT f58 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) not nul x;
-SELECT f58 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) unsigned x;
-SELECT f59 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) unsigned x;
-SELECT f59 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) unsigned x;
-SELECT f60 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) unsigned x;
-SELECT f60 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) zerofill x;
-SELECT f61 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) zerofill x;
-SELECT f61 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) zerofill x;
-SELECT f62 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) zerofill x;
-SELECT f62 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) unsigned zerofill x;
-SELECT f63 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) unsigned zerofill x;
-SELECT f63 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) unsigned zerofill x;
-SELECT f64 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) unsigned zerofill x;
-SELECT f64 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) x;
-SELECT f65 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) x;
-SELECT f65 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) x;
-SELECT f66 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) x;
-SELECT f66 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) unsigned x;
-SELECT f67 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) unsigned x;
-SELECT f67 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) unsigned x;
-SELECT f68 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) unsigned x;
-SELECT f68 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) zerofill x;
-SELECT f69 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) zerofill x;
-SELECT f69 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) zerofill x;
-SELECT f70 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) zerofill x;
-SELECT f70 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) unsigned zerofill x;
-SELECT f71 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) unsigned zerofill x;
-SELECT f71 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) unsigned zerofill x;
-SELECT f72 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) unsigned zerofill x;
-SELECT f72 into x from tb2 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real x;
-SELECT f73 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real x;
-SELECT f73 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real unsigned x;
-SELECT f74 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned x;
-SELECT f74 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real zerofill x;
-SELECT f75 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real zerofill x;
-SELECT f75 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real unsigned zerofill x;
-SELECT f76 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned zerofill x;
-SELECT f76 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double x;
-SELECT f77 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double x;
-SELECT f77 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double unsigned x;
-SELECT f78 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double unsigned x;
-SELECT f78 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double zerofill x;
-SELECT f79 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double zerofill x;
-SELECT f79 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double unsigned zerofill x;
-SELECT f80 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double unsigned zerofill x;
-SELECT f80 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float not null x;
-SELECT f81 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float not null x;
-SELECT f81 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float unsigned not null x;
-SELECT f82 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned not null x;
-SELECT f82 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float zerofill not null x;
-SELECT f83 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float zerofill not null x;
-SELECT f83 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float unsigned zerofill not null x;
-SELECT f84 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned zerofill not null x;
-SELECT f84 into x from tb2 limit 9998, 1;
-E' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) not null x;
-SELECT f85 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) not null x;
-SELECT f85 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) not null x;
-SELECT f86 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) not null x;
-SELECT f86 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) unsigned not null x;
-SELECT f87 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) unsigned not null x;
-SELECT f87 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) unsigned not null x;
-SELECT f88 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) unsigned not null x;
-SELECT f88 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) zerofill not null x;
-SELECT f89 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) zerofill not null x;
-SELECT f89 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) zerofill not null x;
-SELECT f90 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) zerofill not null x;
-SELECT f90 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) unsigned zerofill not null x;
-SELECT f91 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) unsigned zerofill not null x;
-SELECT f91 into x from tb2 limit 9998, 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) unsigned zerofill not null x;
-SELECT f92 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) unsigned zerofill not null x;
-SELECT f92 into x from tb2 limit 9998, ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) not null x;
-SELECT f93 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) not null x;
-SELECT f93 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) not null x;
-SELECT f94 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) not null x;
-SELECT f94 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) unsigned not null x;
-SELECT f95 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) unsigned not null x;
-SELECT f95 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) unsigned not null x;
-SELECT f96 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) unsigned not null x;
-SELECT f96 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) zerofill not null x;
-SELECT f97 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) zerofill not null x;
-SELECT f97 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) zerofill not null x;
-SELECT f98 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) zerofill not null x;
-SELECT f98 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) unsigned zerofill not null x;
-SELECT f99 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) unsigned zerofill not null x;
-SELECT f99 into x from tb2 limit 9998, ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) unsigned zerofill not null x;
-SELECT f100 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) unsigned zerofill not null x;
-SELECT f100 into x from tb2 limit 9998,' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare date not null x;
-SELECT f101 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f101 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare time not null x;
-SELECT f102 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f102 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare datetime not null x;
-SELECT f103 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f103 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare timestamp not null x;
-SELECT f104 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f104 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year not null x;
-SELECT f105 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f105 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year(3) not null x;
-SELECT f106 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(3) not null x;
-SELECT f106 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year(4) not null x;
-SELECT f107 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(4) not null x;
-SELECT f107 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enum("1enum", "2enum") not null x;
-SELECT f108 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '("1enum", "2enum") not null x;
-SELECT f108 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set("1set", "2set") not nul x;
-SELECT f109 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set("1set", "2set") not nul x;
-SELECT f109 into x from tb2 limit 9998, 1;
-END' at line 3
-
-Testcase 4.2.14:
-----------------
-Ensure that the handlers declared for a stored procedure (with the declare
-statement) may only be defined in the correct order
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '23000' set @x2 = 1;
-declare x char;
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor1 cursor for SELECT f1 from tb1;
-declare x char;
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor1 cursor for SELECT f1 from tb1;
-declare sqlcondition condition for sqlstate '02000';
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare sqlcondition condition for sqlstate '02000';
-declare continue handler for sqlcondition set @x=1;
-declare cursor1 cursor for SELECT f1 from tb1;
-END//
-ERROR 42000: Cursor declaration after handler declaration
-
-Testcase 4.2.15:
-----------------
-Ensure that the declare statement can declare multiple variables both separately
-and all at once from a variable list. (multiple declaration)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-DECLARE x1 CHAR(100) DEFAULT 'outer';
-BEGIN
-DECLARE x1 CHAR(100) DEFAULT x1;
-END;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z char default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z char ascii default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinytext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z text default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumtext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z longtext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z blob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z longblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z binary default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint default -126;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--126 -126 -126
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint unsigned default 253;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-253 253 253
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-000 000 000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-001 001 001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint default -32768;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--32768 -32768 -32768
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint unsigned default 65535;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-65535 65535 65535
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000 00000 00000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00001 00001 00001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint default -8388608;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--8388608 -8388608 -8388608
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint unsigned default 16777215;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-16777215 16777215 16777215
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000 00000000 00000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001 00000001 00000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int default -2147483648;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--2147483648 -2147483648 -2147483648
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int unsigned default 4294967295;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-4294967295 4294967295 4294967295
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000001 0000000001 0000000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint default -9223372036854775808;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--9223372036854775808 -9223372036854775808 -9223372036854775808
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint unsigned default 18446744073709551615;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-18446744073709551615 18446744073709551615 18446744073709551615
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000000000000000 00000000000000000000 00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000000000000001 00000000000000000001 00000000000000000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal default -34028234660123456789012345678901234567;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--9999999999 -9999999999 -9999999999
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal zerofill default -34028234660123456789012345678901234567;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.175494351e-38 1.175494351e-38 1.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.175494351e-38 1.175494351e-38 1.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001.175494351e-38 00000001.175494351e-38 00000001.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001.175494351e-38 00000001.175494351e-38 00000001.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.17549e-38 1.17549e-38 1.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.17549e-38 1.17549e-38 1.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-01.17549e-38 01.17549e-38 01.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-01.17549e-38 01.17549e-38 01.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z date default '2005-02-02';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 2005-02-02 2005-02-02
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z time default '12:20:12';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-12:20:12 12:20:12 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z datetime default '2005-02-02 12:20:12';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 12:20:12 2005-02-02 12:20:12 2005-02-02 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z timestamp default '20050202122012';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 12:20:12 2005-02-02 12:20:12 2005-02-02 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year(3) default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year(4) default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z enum("1enum", "2enum") default "2enum";
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2enum 2enum 2enum
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z set("1set", "2set") default "2set";
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2set 2set 2set
-DROP PROCEDURE sp1;
-
-Testcase 4.2.16:
-----------------
-Ensure that the declare statement can declare multiple variables both separately
-and all at once from a variable list. (multiple declaration).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare a, b char default '2';
-declare c, d float default 1.3;
-declare e, f text default 'text';
-declare g, h enum("value1", "value2" ) default 'value1';
-declare i, j datetime default '2005-02-02 12:12:12';
-declare k, l blob default 'blob';
-SELECT a, b, c, d, e, f, g, h, k, l;
-END//
-CALL sp6();
-a b c d e f g h k l
-2 2 1.3 1.3 text text value1 value1 blob blob
-DROP PROCEDURE sp6;
-
-Testcase 4.2.17:
-----------------
-Ensure that the invalid variable declarations are rejected, with an appropriate
-error message.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare @x char;
-SELECT f2 into x from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@x char;
-SELECT f2 into x from t2 limit 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare accessible char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare add char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare all char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare alter char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare analyze char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare and char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare as char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare asc char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare asensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare before char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare between char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare bigint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare binary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare blob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare both char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare by char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare call char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cascade char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare case char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare change char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare char char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare character char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare check char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare collate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare column char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare condition char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare constraint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare convert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare create char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cross char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_date char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_time char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_timestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_user char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cursor char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare database char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare databases char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_hour char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_minute char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare dec char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare decimal char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare declare char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare default char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare delayed char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare delete char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare desc char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare describe char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare deterministic char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare distinct char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare distinctrow char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare div char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare double char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare drop char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare dual char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare each char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare else char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare elseif char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare enclosed char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare escaped char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare exists char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare exit char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare explain char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare false char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare fetch char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float4 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float8 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare for char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare force char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare foreign char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare from char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare fulltext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare grant char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare group char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare having char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare high_priority char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_minute char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare if char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare ignore char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare in char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare index char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare infile char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare inner char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare inout char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare insensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare insert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int1 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int2 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int3 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int4 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int8 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare integer char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare interval char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare into char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare is char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare iterate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare join char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare key char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare keys char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare kill char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare leading char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare leave char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare left char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare like char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare limit char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare linear char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare lines char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare load char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare localtime char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare localtimestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare lock char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare long char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare longblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare longtext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare loop char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare low_priority char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare master_ssl_verify_server_cert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare match char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumtext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare middleint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare minute_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare minute_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mod char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare modifies char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare natural char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare not char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare no_write_to_binlog char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare null char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare numeric char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare on char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare optimize char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare option char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare optionally char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare or char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare order char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare out char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare outer char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare outfile char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare precision char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare primary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare procedure char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare purge char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare range char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare reads char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read_only char;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read_write char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare real char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare references char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare regexp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare release char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare rename char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare repeat char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare replace char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare require char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare restrict char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare return char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare revoke char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare right char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare rlike char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare schema char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare schemas char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare second_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare SELECT char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare separator char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare set char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare show char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare smallint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare spatial char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare specific char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlexception char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlstate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlwarning char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_big_result char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_calc_found_rows char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_small_result char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare ssl char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare starting char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare straight_join char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare table char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare terminated char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare then char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinyblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinyint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinytext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare to char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare trailing char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare trigger char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare true char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare undo char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare union char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unique char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unlock char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unsigned char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare update char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare usage char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare use char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare using char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_date char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_time char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_timestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare values char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varbinary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varchar char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varcharacter char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varying char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare when char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare where char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare while char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare with char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare write char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xor char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare year_month char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare zerofill char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill char;
-END' at line 3
-
-Testcase :
-----------
-Ensure that every possible type of condition may be declared for a stored procedure
-( covered in more detail in handlers section.)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'HY000';
-declare cond2 condition for sqlstate '23000';
-declare cond3 condition for sqlstate 'HY001';
-declare cond4 condition for sqlstate '08004';
-declare cond5 condition for sqlstate '08S01';
-declare cond6 condition for sqlstate '42000';
-declare cond7 condition for sqlstate '28000';
-declare cond8 condition for sqlstate '3D000';
-declare cond9 condition for sqlstate '42S01';
-declare cond10 condition for sqlstate '42S02';
-declare cond11 condition for sqlstate '42S22';
-declare cond12 condition for sqlstate '21S01';
-declare cond13 condition for sqlstate '42S21';
-declare cond14 condition for sqlstate '42S12';
-declare cond15 condition for sqlstate '22004';
-declare cond16 condition for sqlstate '25000';
-declare cond17 condition for sqlstate '40001';
-declare cond18 condition for sqlstate '21000';
-declare cond19 condition for sqlstate '01000';
-declare cond20 condition for sqlstate '22003';
-declare cond21 condition for sqlstate '22007';
-declare cond22 condition for sqlstate '0A000';
-declare cond23 condition for sqlstate '70100';
-declare cond24 condition for sqlstate '2F005';
-declare cond25 condition for sqlstate '24000';
-declare cond26 condition for sqlstate '02000';
-declare continue handler for cond2 set @x2 = 1;
-declare continue handler for cond1 set @x2 = 1;
-declare continue handler for cond3 set @x2 = 1;
-declare continue handler for cond4 set @x2 = 1;
-declare continue handler for cond5 set @x2 = 1;
-declare continue handler for cond7 set @x2 = 1;
-declare continue handler for cond6 set @x2 = 1;
-declare continue handler for cond8 set @x2 = 1;
-declare continue handler for cond9 set @x2 = 1;
-declare continue handler for cond10 set @x2 = 1;
-declare continue handler for cond11 set @x2 = 1;
-declare continue handler for cond12 set @x2 = 1;
-declare continue handler for cond13 set @x2 = 1;
-declare continue handler for cond14 set @x2 = 1;
-declare continue handler for cond15 set @x2 = 1;
-declare continue handler for cond16 set @x2 = 1;
-declare continue handler for cond17 set @x2 = 1;
-declare continue handler for cond18 set @x2 = 1;
-declare continue handler for cond19 set @x2 = 1;
-declare continue handler for cond20 set @x2 = 1;
-declare continue handler for cond21 set @x2 = 1;
-declare continue handler for cond22 set @x2 = 1;
-declare continue handler for cond23 set @x2 = 1;
-declare continue handler for cond24 set @x2 = 1;
-declare continue handler for cond25 set @x2 = 1;
-declare continue handler for cond26 set @x2 = 1;
-set @x = 1;
-insert into t2 values (1);
-set @x = 2;
-insert into t2 values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare @x char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@x char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare accessible condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible condition for sqlstate '02000';
-declare exit handler for add set @var' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare add condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare all condition for sqlstate '02000';
-declare exit handler for all set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all condition for sqlstate '02000';
-declare exit handler for all set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare alter condition for sqlstate '02000';
-declare exit handler for alter set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter condition for sqlstate '02000';
-declare exit handler for alter set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare analyze condition for sqlstate '02000';
-declare exit handler for analyze set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze condition for sqlstate '02000';
-declare exit handler for analyze set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare and condition for sqlstate '02000';
-declare exit handler for and set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and condition for sqlstate '02000';
-declare exit handler for and set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare as condition for sqlstate '02000';
-declare exit handler for as set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as condition for sqlstate '02000';
-declare exit handler for as set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asc condition for sqlstate '02000';
-declare exit handler for asc set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc condition for sqlstate '02000';
-declare exit handler for asc set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asensitive condition for sqlstate '02000';
-declare exit handler for asensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive condition for sqlstate '02000';
-declare exit handler for asensitive s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare before condition for sqlstate '02000';
-declare exit handler for before set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before condition for sqlstate '02000';
-declare exit handler for before set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare between condition for sqlstate '02000';
-declare exit handler for between set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between condition for sqlstate '02000';
-declare exit handler for between set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint condition for sqlstate '02000';
-declare exit handler for bigint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint condition for sqlstate '02000';
-declare exit handler for bigint set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary condition for sqlstate '02000';
-declare exit handler for binary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary condition for sqlstate '02000';
-declare exit handler for binary set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob condition for sqlstate '02000';
-declare exit handler for blob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob condition for sqlstate '02000';
-declare exit handler for blob set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare both condition for sqlstate '02000';
-declare exit handler for both set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both condition for sqlstate '02000';
-declare exit handler for both set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare by condition for sqlstate '02000';
-declare exit handler for by set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by condition for sqlstate '02000';
-declare exit handler for by set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare call condition for sqlstate '02000';
-declare exit handler for CALL set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call condition for sqlstate '02000';
-declare exit handler for CALL set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cascade condition for sqlstate '02000';
-declare exit handler for cascade set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade condition for sqlstate '02000';
-declare exit handler for cascade set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare case condition for sqlstate '02000';
-declare exit handler for case set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case condition for sqlstate '02000';
-declare exit handler for case set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare change condition for sqlstate '02000';
-declare exit handler for change set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change condition for sqlstate '02000';
-declare exit handler for change set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char condition for sqlstate '02000';
-declare exit handler for char set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char condition for sqlstate '02000';
-declare exit handler for char set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare character condition for sqlstate '02000';
-declare exit handler for character set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character condition for sqlstate '02000';
-declare exit handler for character set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare check condition for sqlstate '02000';
-declare exit handler for check set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check condition for sqlstate '02000';
-declare exit handler for check set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare collate condition for sqlstate '02000';
-declare exit handler for collate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate condition for sqlstate '02000';
-declare exit handler for collate set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare column condition for sqlstate '02000';
-declare exit handler for column set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column condition for sqlstate '02000';
-declare exit handler for column set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare condition condition for sqlstate '02000';
-declare exit handler for condition set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition condition for sqlstate '02000';
-declare exit handler for condition set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare connection condition for sqlstate '02000';
-declare exit handler for connection set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare constraint condition for sqlstate '02000';
-declare exit handler for constraint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint condition for sqlstate '02000';
-declare exit handler for constraint s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare continue condition for sqlstate '02000';
-declare exit handler for continue set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for continue set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare convert condition for sqlstate '02000';
-declare exit handler for convert set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert condition for sqlstate '02000';
-declare exit handler for convert set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare create condition for sqlstate '02000';
-declare exit handler for create set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create condition for sqlstate '02000';
-declare exit handler for create set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cross condition for sqlstate '02000';
-declare exit handler for cross set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross condition for sqlstate '02000';
-declare exit handler for cross set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_date condition for sqlstate '02000';
-declare exit handler for current_date set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date condition for sqlstate '02000';
-declare exit handler for current_da' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_time condition for sqlstate '02000';
-declare exit handler for current_time set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time condition for sqlstate '02000';
-declare exit handler for current_ti' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_timestamp condition for sqlstate '02000';
-declare exit handler for current_timestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp condition for sqlstate '02000';
-declare exit handler for curre' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_user condition for sqlstate '02000';
-declare exit handler for current_user set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user condition for sqlstate '02000';
-declare exit handler for current_us' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cursor condition for sqlstate '02000';
-declare exit handler for cursor set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor condition for sqlstate '02000';
-declare exit handler for cursor set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare database condition for sqlstate '02000';
-declare exit handler for database set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database condition for sqlstate '02000';
-declare exit handler for database set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare databases condition for sqlstate '02000';
-declare exit handler for databases set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases condition for sqlstate '02000';
-declare exit handler for databases set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_hour condition for sqlstate '02000';
-declare exit handler for day_hour set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour condition for sqlstate '02000';
-declare exit handler for day_hour set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_microsecond condition for sqlstate '02000';
-declare exit handler for day_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond condition for sqlstate '02000';
-declare exit handler for day_mic' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_minute condition for sqlstate '02000';
-declare exit handler for day_minute set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute condition for sqlstate '02000';
-declare exit handler for day_minute s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_second condition for sqlstate '02000';
-declare exit handler for day_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second condition for sqlstate '02000';
-declare exit handler for day_second s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dec condition for sqlstate '02000';
-declare exit handler for dec set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec condition for sqlstate '02000';
-declare exit handler for dec set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal condition for sqlstate '02000';
-declare exit handler for decimal set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal condition for sqlstate '02000';
-declare exit handler for decimal set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare declare condition for sqlstate '02000';
-declare exit handler for declare set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare condition for sqlstate '02000';
-declare exit handler for declare set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare default condition for sqlstate '02000';
-declare exit handler for default set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default condition for sqlstate '02000';
-declare exit handler for default set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delayed condition for sqlstate '02000';
-declare exit handler for delayed set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed condition for sqlstate '02000';
-declare exit handler for delayed set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delete condition for sqlstate '02000';
-declare exit handler for delete set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete condition for sqlstate '02000';
-declare exit handler for delete set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare desc condition for sqlstate '02000';
-declare exit handler for desc set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc condition for sqlstate '02000';
-declare exit handler for desc set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare describe condition for sqlstate '02000';
-declare exit handler for describe set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe condition for sqlstate '02000';
-declare exit handler for describe set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare deterministic condition for sqlstate '02000';
-declare exit handler for deterministic set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic condition for sqlstate '02000';
-declare exit handler for determini' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinct condition for sqlstate '02000';
-declare exit handler for distinct set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct condition for sqlstate '02000';
-declare exit handler for distinct set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinctrow condition for sqlstate '02000';
-declare exit handler for distinctrow set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow condition for sqlstate '02000';
-declare exit handler for distinctrow' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare div condition for sqlstate '02000';
-declare exit handler for div set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div condition for sqlstate '02000';
-declare exit handler for div set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double condition for sqlstate '02000';
-declare exit handler for double set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double condition for sqlstate '02000';
-declare exit handler for double set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare drop condition for sqlstate '02000';
-declare exit handler for drop set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop condition for sqlstate '02000';
-declare exit handler for drop set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dual condition for sqlstate '02000';
-declare exit handler for dual set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual condition for sqlstate '02000';
-declare exit handler for dual set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare each condition for sqlstate '02000';
-declare exit handler for each set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each condition for sqlstate '02000';
-declare exit handler for each set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare else condition for sqlstate '02000';
-declare exit handler for else set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else condition for sqlstate '02000';
-declare exit handler for else set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare elseif condition for sqlstate '02000';
-declare exit handler for elseif set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif condition for sqlstate '02000';
-declare exit handler for elseif set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enclosed condition for sqlstate '02000';
-declare exit handler for enclosed set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed condition for sqlstate '02000';
-declare exit handler for enclosed set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare escaped condition for sqlstate '02000';
-declare exit handler for escaped set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped condition for sqlstate '02000';
-declare exit handler for escaped set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exists condition for sqlstate '02000';
-declare exit handler for exists set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists condition for sqlstate '02000';
-declare exit handler for exists set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exit condition for sqlstate '02000';
-declare exit handler for exit set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for exit set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare explain condition for sqlstate '02000';
-declare exit handler for explain set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain condition for sqlstate '02000';
-declare exit handler for explain set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare false condition for sqlstate '02000';
-declare exit handler for false set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false condition for sqlstate '02000';
-declare exit handler for false set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fetch condition for sqlstate '02000';
-declare exit handler for fetch set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch condition for sqlstate '02000';
-declare exit handler for fetch set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float condition for sqlstate '02000';
-declare exit handler for float set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float condition for sqlstate '02000';
-declare exit handler for float set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float4 condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 condition for sqlstate '02000';
-declare exit handler for add set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float8 condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 condition for sqlstate '02000';
-declare exit handler for add set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare for condition for sqlstate '02000';
-declare exit handler for for set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for condition for sqlstate '02000';
-declare exit handler for for set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare force condition for sqlstate '02000';
-declare exit handler for force set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force condition for sqlstate '02000';
-declare exit handler for force set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare foreign condition for sqlstate '02000';
-declare exit handler for foreign set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign condition for sqlstate '02000';
-declare exit handler for foreign set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare from condition for sqlstate '02000';
-declare exit handler for from set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from condition for sqlstate '02000';
-declare exit handler for from set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fulltext condition for sqlstate '02000';
-declare exit handler for fulltext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext condition for sqlstate '02000';
-declare exit handler for fulltext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare grant condition for sqlstate '02000';
-declare exit handler for grant set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant condition for sqlstate '02000';
-declare exit handler for grant set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare group condition for sqlstate '02000';
-declare exit handler for group set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group condition for sqlstate '02000';
-declare exit handler for group set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare having condition for sqlstate '02000';
-declare exit handler for having set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having condition for sqlstate '02000';
-declare exit handler for having set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare high_priority condition for sqlstate '02000';
-declare exit handler for high_priority set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority condition for sqlstate '02000';
-declare exit handler for high_prio' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_microsecond condition for sqlstate '02000';
-declare exit handler for hour_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond condition for sqlstate '02000';
-declare exit handler for hour_m' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_minute condition for sqlstate '02000';
-declare exit handler for hour_minute set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute condition for sqlstate '02000';
-declare exit handler for hour_minute' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_second condition for sqlstate '02000';
-declare exit handler for hour_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second condition for sqlstate '02000';
-declare exit handler for hour_second' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare if condition for sqlstate '02000';
-declare exit handler for if set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if condition for sqlstate '02000';
-declare exit handler for if set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ignore condition for sqlstate '02000';
-declare exit handler for ignore set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore condition for sqlstate '02000';
-declare exit handler for ignore set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare in condition for sqlstate '02000';
-declare exit handler for in set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in condition for sqlstate '02000';
-declare exit handler for in set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare index condition for sqlstate '02000';
-declare exit handler for index set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index condition for sqlstate '02000';
-declare exit handler for index set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare infile condition for sqlstate '02000';
-declare exit handler for infile set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile condition for sqlstate '02000';
-declare exit handler for infile set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inner condition for sqlstate '02000';
-declare exit handler for inner set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner condition for sqlstate '02000';
-declare exit handler for inner set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inout condition for sqlstate '02000';
-declare exit handler for inout set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout condition for sqlstate '02000';
-declare exit handler for inout set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insensitive condition for sqlstate '02000';
-declare exit handler for insensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive condition for sqlstate '02000';
-declare exit handler for insensitive' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insert condition for sqlstate '02000';
-declare exit handler for insert set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert condition for sqlstate '02000';
-declare exit handler for insert set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int1 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int2 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int3 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int4 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int8 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare integer condition for sqlstate '02000';
-declare exit handler for integer set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer condition for sqlstate '02000';
-declare exit handler for integer set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare interval condition for sqlstate '02000';
-declare exit handler for interval set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval condition for sqlstate '02000';
-declare exit handler for interval set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare into condition for sqlstate '02000';
-declare exit handler for into set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into condition for sqlstate '02000';
-declare exit handler for into set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare is condition for sqlstate '02000';
-declare exit handler for is set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is condition for sqlstate '02000';
-declare exit handler for is set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare iterate condition for sqlstate '02000';
-declare exit handler for iterate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate condition for sqlstate '02000';
-declare exit handler for iterate set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare join condition for sqlstate '02000';
-declare exit handler for join set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join condition for sqlstate '02000';
-declare exit handler for join set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare key condition for sqlstate '02000';
-declare exit handler for key set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key condition for sqlstate '02000';
-declare exit handler for key set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare keys condition for sqlstate '02000';
-declare exit handler for keys set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys condition for sqlstate '02000';
-declare exit handler for keys set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare kill condition for sqlstate '02000';
-declare exit handler for kill set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill condition for sqlstate '02000';
-declare exit handler for kill set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leading condition for sqlstate '02000';
-declare exit handler for leading set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading condition for sqlstate '02000';
-declare exit handler for leading set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leave condition for sqlstate '02000';
-declare exit handler for leave set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave condition for sqlstate '02000';
-declare exit handler for leave set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare left condition for sqlstate '02000';
-declare exit handler for left set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left condition for sqlstate '02000';
-declare exit handler for left set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare like condition for sqlstate '02000';
-declare exit handler for like set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like condition for sqlstate '02000';
-declare exit handler for like set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare limit condition for sqlstate '02000';
-declare exit handler for limit set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit condition for sqlstate '02000';
-declare exit handler for limit set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare linear condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear condition for sqlstate '02000';
-declare exit handler for int set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lines condition for sqlstate '02000';
-declare exit handler for lines set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines condition for sqlstate '02000';
-declare exit handler for lines set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare load condition for sqlstate '02000';
-declare exit handler for load set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load condition for sqlstate '02000';
-declare exit handler for load set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtime condition for sqlstate '02000';
-declare exit handler for localtime set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime condition for sqlstate '02000';
-declare exit handler for localtime set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtimestamp condition for sqlstate '02000';
-declare exit handler for localtimestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp condition for sqlstate '02000';
-declare exit handler for localtim' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lock condition for sqlstate '02000';
-declare exit handler for lock set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock condition for sqlstate '02000';
-declare exit handler for lock set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare long condition for sqlstate '02000';
-declare exit handler for long set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long condition for sqlstate '02000';
-declare exit handler for long set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob condition for sqlstate '02000';
-declare exit handler for longblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob condition for sqlstate '02000';
-declare exit handler for longblob set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext condition for sqlstate '02000';
-declare exit handler for longtext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext condition for sqlstate '02000';
-declare exit handler for longtext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare loop condition for sqlstate '02000';
-declare exit handler for loop set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop condition for sqlstate '02000';
-declare exit handler for loop set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare low_priority condition for sqlstate '02000';
-declare exit handler for low_priority set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority condition for sqlstate '02000';
-declare exit handler for low_priori' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare master_ssl_verify_server_cert condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert condition for sqlstate '02000';
-declare exit handl' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare match condition for sqlstate '02000';
-declare exit handler for match set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match condition for sqlstate '02000';
-declare exit handler for match set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob condition for sqlstate '02000';
-declare exit handler for mediumblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob condition for sqlstate '02000';
-declare exit handler for mediumblob s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint condition for sqlstate '02000';
-declare exit handler for mediumint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint condition for sqlstate '02000';
-declare exit handler for mediumint set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext condition for sqlstate '02000';
-declare exit handler for mediumtext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext condition for sqlstate '02000';
-declare exit handler for mediumtext s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare middleint condition for sqlstate '02000';
-declare exit handler for middleint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint condition for sqlstate '02000';
-declare exit handler for middleint set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_microsecond condition for sqlstate '02000';
-declare exit handler for minute_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond condition for sqlstate '02000';
-declare exit handler for minu' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_second condition for sqlstate '02000';
-declare exit handler for minute_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second condition for sqlstate '02000';
-declare exit handler for minute_se' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mod condition for sqlstate '02000';
-declare exit handler for mod set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod condition for sqlstate '02000';
-declare exit handler for mod set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare modifies condition for sqlstate '02000';
-declare exit handler for modifies set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies condition for sqlstate '02000';
-declare exit handler for modifies set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare natural condition for sqlstate '02000';
-declare exit handler for natural set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural condition for sqlstate '02000';
-declare exit handler for natural set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare not condition for sqlstate '02000';
-declare exit handler for not set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not condition for sqlstate '02000';
-declare exit handler for not set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare no_write_to_binlog condition for sqlstate '02000';
-declare exit handler for no_write_to_binlog set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog condition for sqlstate '02000';
-declare exit handler for no_w' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare null condition for sqlstate '02000';
-declare exit handler for null set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null condition for sqlstate '02000';
-declare exit handler for null set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric condition for sqlstate '02000';
-declare exit handler for numeric set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric condition for sqlstate '02000';
-declare exit handler for numeric set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare on condition for sqlstate '02000';
-declare exit handler for on set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on condition for sqlstate '02000';
-declare exit handler for on set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optimize condition for sqlstate '02000';
-declare exit handler for optimize set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize condition for sqlstate '02000';
-declare exit handler for optimize set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare option condition for sqlstate '02000';
-declare exit handler for option set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option condition for sqlstate '02000';
-declare exit handler for option set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optionally condition for sqlstate '02000';
-declare exit handler for optionally set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally condition for sqlstate '02000';
-declare exit handler for optionally s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare or condition for sqlstate '02000';
-declare exit handler for or set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or condition for sqlstate '02000';
-declare exit handler for or set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare order condition for sqlstate '02000';
-declare exit handler for order set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order condition for sqlstate '02000';
-declare exit handler for order set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare out condition for sqlstate '02000';
-declare exit handler for out set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out condition for sqlstate '02000';
-declare exit handler for out set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outer condition for sqlstate '02000';
-declare exit handler for outer set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer condition for sqlstate '02000';
-declare exit handler for outer set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outfile condition for sqlstate '02000';
-declare exit handler for outfile set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile condition for sqlstate '02000';
-declare exit handler for outfile set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare precision condition for sqlstate '02000';
-declare exit handler for precision set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision condition for sqlstate '02000';
-declare exit handler for precision set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare primary condition for sqlstate '02000';
-declare exit handler for primary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary condition for sqlstate '02000';
-declare exit handler for primary set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare procedure condition for sqlstate '02000';
-declare exit handler for procedure set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure condition for sqlstate '02000';
-declare exit handler for procedure set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare purge condition for sqlstate '02000';
-declare exit handler for purge set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge condition for sqlstate '02000';
-declare exit handler for purge set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare range condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read condition for sqlstate '02000';
-declare exit handler for read set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read condition for sqlstate '02000';
-declare exit handler for read set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare reads condition for sqlstate '02000';
-declare exit handler for reads set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads condition for sqlstate '02000';
-declare exit handler for reads set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_only condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int set @var2 = 1;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_write condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write condition for sqlstate '02000';
-declare exit handler for int set @var' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real condition for sqlstate '02000';
-declare exit handler for real set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real condition for sqlstate '02000';
-declare exit handler for real set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare references condition for sqlstate '02000';
-declare exit handler for references set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references condition for sqlstate '02000';
-declare exit handler for references s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare regexp condition for sqlstate '02000';
-declare exit handler for regexp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp condition for sqlstate '02000';
-declare exit handler for regexp set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare release condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release condition for sqlstate '02000';
-declare exit handler for int set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rename condition for sqlstate '02000';
-declare exit handler for rename set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename condition for sqlstate '02000';
-declare exit handler for rename set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare repeat condition for sqlstate '02000';
-declare exit handler for repeat set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat condition for sqlstate '02000';
-declare exit handler for repeat set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare replace condition for sqlstate '02000';
-declare exit handler for replace set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace condition for sqlstate '02000';
-declare exit handler for replace set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare require condition for sqlstate '02000';
-declare exit handler for require set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require condition for sqlstate '02000';
-declare exit handler for require set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare restrict condition for sqlstate '02000';
-declare exit handler for restrict set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict condition for sqlstate '02000';
-declare exit handler for restrict set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare return condition for sqlstate '02000';
-declare exit handler for return set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return condition for sqlstate '02000';
-declare exit handler for return set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare revoke condition for sqlstate '02000';
-declare exit handler for revoke set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke condition for sqlstate '02000';
-declare exit handler for revoke set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare right condition for sqlstate '02000';
-declare exit handler for right set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right condition for sqlstate '02000';
-declare exit handler for right set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rlike condition for sqlstate '02000';
-declare exit handler for rlike set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike condition for sqlstate '02000';
-declare exit handler for rlike set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schema condition for sqlstate '02000';
-declare exit handler for schema set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema condition for sqlstate '02000';
-declare exit handler for schema set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schemas condition for sqlstate '02000';
-declare exit handler for schemas set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas condition for sqlstate '02000';
-declare exit handler for schemas set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare second_microsecond condition for sqlstate '02000';
-declare exit handler for second_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond condition for sqlstate '02000';
-declare exit handler for seco' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare select condition for sqlstate '02000';
-declare exit handler for SELECT set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select condition for sqlstate '02000';
-declare exit handler for SELECT set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sensitive condition for sqlstate '02000';
-declare exit handler for sensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive condition for sqlstate '02000';
-declare exit handler for sensitive set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare separator condition for sqlstate '02000';
-declare exit handler for separator set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator condition for sqlstate '02000';
-declare exit handler for separator set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set condition for sqlstate '02000';
-declare exit handler for set set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set condition for sqlstate '02000';
-declare exit handler for set set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare show condition for sqlstate '02000';
-declare exit handler for show set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show condition for sqlstate '02000';
-declare exit handler for show set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint condition for sqlstate '02000';
-declare exit handler for smallint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint condition for sqlstate '02000';
-declare exit handler for smallint set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare spatial condition for sqlstate '02000';
-declare exit handler for spatial set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial condition for sqlstate '02000';
-declare exit handler for spatial set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare specific condition for sqlstate '02000';
-declare exit handler for specific set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific condition for sqlstate '02000';
-declare exit handler for specific set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql condition for sqlstate '02000';
-declare exit handler for sql set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql condition for sqlstate '02000';
-declare exit handler for sql set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlexception condition for sqlstate '02000';
-declare exit handler for sqlexception set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception condition for sqlstate '02000';
-declare exit handler for sqlexcepti' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlstate condition for sqlstate '02000';
-declare exit handler for sqlstate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate condition for sqlstate '02000';
-declare exit handler for sqlstate set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlwarning condition for sqlstate '02000';
-declare exit handler for sqlwarning set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning condition for sqlstate '02000';
-declare exit handler for sqlwarning s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_big_result condition for sqlstate '02000';
-declare exit handler for sql_big_result set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result condition for sqlstate '02000';
-declare exit handler for sql_big_' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_calc_found_rows condition for sqlstate '02000';
-declare exit handler for sql_calc_found_rows set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows condition for sqlstate '02000';
-declare exit handler for sql' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_small_result condition for sqlstate '02000';
-declare exit handler for sql_small_result set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result condition for sqlstate '02000';
-declare exit handler for sql_sm' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ssl condition for sqlstate '02000';
-declare exit handler for ssl set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl condition for sqlstate '02000';
-declare exit handler for ssl set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare starting condition for sqlstate '02000';
-declare exit handler for starting set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting condition for sqlstate '02000';
-declare exit handler for starting set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare straight_join condition for sqlstate '02000';
-declare exit handler for straight_join set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join condition for sqlstate '02000';
-declare exit handler for straight_' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare table condition for sqlstate '02000';
-declare exit handler for table set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table condition for sqlstate '02000';
-declare exit handler for table set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare terminated condition for sqlstate '02000';
-declare exit handler for terminated set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated condition for sqlstate '02000';
-declare exit handler for terminated s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare then condition for sqlstate '02000';
-declare exit handler for then set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then condition for sqlstate '02000';
-declare exit handler for then set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob condition for sqlstate '02000';
-declare exit handler for tinyblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob condition for sqlstate '02000';
-declare exit handler for tinyblob set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint condition for sqlstate '02000';
-declare exit handler for tinyint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint condition for sqlstate '02000';
-declare exit handler for tinyint set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext condition for sqlstate '02000';
-declare exit handler for tinytext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext condition for sqlstate '02000';
-declare exit handler for tinytext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare to condition for sqlstate '02000';
-declare exit handler for to set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to condition for sqlstate '02000';
-declare exit handler for to set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trailing condition for sqlstate '02000';
-declare exit handler for trailing set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing condition for sqlstate '02000';
-declare exit handler for trailing set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trigger condition for sqlstate '02000';
-declare exit handler for trigger set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger condition for sqlstate '02000';
-declare exit handler for trigger set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare true condition for sqlstate '02000';
-declare exit handler for true set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true condition for sqlstate '02000';
-declare exit handler for true set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare undo condition for sqlstate '02000';
-declare exit handler for undo set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo condition for sqlstate '02000';
-declare exit handler for undo set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare union condition for sqlstate '02000';
-declare exit handler for union set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union condition for sqlstate '02000';
-declare exit handler for union set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unique condition for sqlstate '02000';
-declare exit handler for unique set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique condition for sqlstate '02000';
-declare exit handler for unique set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unlock condition for sqlstate '02000';
-declare exit handler for unlock set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock condition for sqlstate '02000';
-declare exit handler for unlock set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unsigned condition for sqlstate '02000';
-declare exit handler for unsigned set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned condition for sqlstate '02000';
-declare exit handler for unsigned set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare update condition for sqlstate '02000';
-declare exit handler for update set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update condition for sqlstate '02000';
-declare exit handler for update set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare usage condition for sqlstate '02000';
-declare exit handler for usage set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage condition for sqlstate '02000';
-declare exit handler for usage set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare use condition for sqlstate '02000';
-declare exit handler for USE set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use condition for sqlstate '02000';
-declare exit handler for USE set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare using condition for sqlstate '02000';
-declare exit handler for using set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using condition for sqlstate '02000';
-declare exit handler for using set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_date condition for sqlstate '02000';
-declare exit handler for utc_date set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date condition for sqlstate '02000';
-declare exit handler for utc_date set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_time condition for sqlstate '02000';
-declare exit handler for utc_time set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time condition for sqlstate '02000';
-declare exit handler for utc_time set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_timestamp condition for sqlstate '02000';
-declare exit handler for utc_timestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp condition for sqlstate '02000';
-declare exit handler for utc_times' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare values condition for sqlstate '02000';
-declare exit handler for values set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values condition for sqlstate '02000';
-declare exit handler for values set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varbinary condition for sqlstate '02000';
-declare exit handler for varbinary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary condition for sqlstate '02000';
-declare exit handler for varbinary set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varchar condition for sqlstate '02000';
-declare exit handler for varchar set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar condition for sqlstate '02000';
-declare exit handler for varchar set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varcharacter condition for sqlstate '02000';
-declare exit handler for varcharacter set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter condition for sqlstate '02000';
-declare exit handler for varcharact' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varying condition for sqlstate '02000';
-declare exit handler for varying set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying condition for sqlstate '02000';
-declare exit handler for varying set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare when condition for sqlstate '02000';
-declare exit handler for when set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when condition for sqlstate '02000';
-declare exit handler for when set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare where condition for sqlstate '02000';
-declare exit handler for where set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where condition for sqlstate '02000';
-declare exit handler for where set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare while condition for sqlstate '02000';
-declare exit handler for while set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while condition for sqlstate '02000';
-declare exit handler for while set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare with condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare write condition for sqlstate '02000';
-declare exit handler for write set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write condition for sqlstate '02000';
-declare exit handler for write set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare xor condition for sqlstate '02000';
-declare exit handler for xor set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor condition for sqlstate '02000';
-declare exit handler for xor set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year_month condition for sqlstate '02000';
-declare exit handler for year_month set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month condition for sqlstate '02000';
-declare exit handler for year_month s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare zerofill condition for sqlstate '02000';
-declare exit handler for zerofill set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill condition for sqlstate '02000';
-declare exit handler for zerofill set @' at line 3
-
-Testcase :
-----------
-Ensure that every possible type of handler may be declared for
-a stored procedure (continue- handler_type ).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t2(f1) values (1);
-set @x = 2;
-insert into t2(f1) values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare undo handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t values ' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare continueinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare undoinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare exitinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare accessible handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare add handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare all handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare alter handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare analyze handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare and handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare as handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asc handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare before handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare between handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare both handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare by handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare call handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cascade handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare case handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare change handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare character handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare check handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare collate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare column handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare condition handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare constraint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare continue handler for sqlstate '02000' set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare convert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare create handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cross handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_date handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_time handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_timestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_user handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cursor handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare database handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare databases handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_hour handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_minute handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dec handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare declare handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare default handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delayed handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delete handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare desc handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare describe handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare deterministic handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinct handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinctrow handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare div handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare drop handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dual handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare each handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare else handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare elseif handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enclosed handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare escaped handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exists handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exit handler for sqlstate '02000' set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare explain handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare false handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fetch handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float4 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float8 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare for handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare force handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare foreign handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare from handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fulltext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare grant handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare group handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare having handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare high_priority handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_minute handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare if handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ignore handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare in handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare index handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare infile handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inner handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inout handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int1 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int2 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int3 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int4 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int8 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare integer handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare interval handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare into handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare is handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare iterate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare join handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare key handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare keys handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare kill handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leading handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leave handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare left handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare like handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare limit handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare linear handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lines handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare load handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtime handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtimestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lock handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare long handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare loop handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare low_priority handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare master_ssl_verify_server_cert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare match handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare middleint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mod handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare modifies handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare natural handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare not handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare no_write_to_binlog handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare null handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare on handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optimize handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare option handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optionally handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare or handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare order handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare out handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outer handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outfile handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare precision handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare primary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare privileges handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare procedure handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare purge handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare range handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare reads handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_only handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_write handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare references handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare regexp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare release handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rename handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare repeat handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare replace handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare require handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare restrict handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare return handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare revoke handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare right handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rlike handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schema handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schemas handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare second_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare select handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare separator handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare show handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare spatial handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare specific handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlexception handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlstate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlwarning handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_big_result handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_calc_found_rows handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_small_result handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ssl handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare starting handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare straight_join handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare table handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare terminated handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare then handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare to handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trailing handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trigger handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare true handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare undo handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare union handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unique handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unlock handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unsigned handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare update handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare usage handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare use handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare using handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_date handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_time handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_timestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare values handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varbinary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varchar handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varcharacter handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varying handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare when handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare where handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare while handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare with handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare write handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare xor handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year_month handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare zerofill handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-USE db_storedproc;
-
-Testcase 4.2.26:
---------------------------------------------------------------------------------
-set @v1='0';
-set @v2='0';
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x char;
-declare y char;
-declare cond1 condition for sqlstate '42000';
-declare cur1 cursor for SELECT f1 from t2 limit 1;
-declare continue handler for cond1 set @x = 4;
-set @x = '1';
-set @y = '2';
-BEGIN
-declare x char;
-declare y char;
-declare cur1 cursor for SELECT f1 from t2 limit 2, 1;
-declare continue handler for sqlstate '42000' set @x = 3;
-open cur1;
-fetch cur1 into y;
-close cur1;
-CALL nonsexist();
-SELECT x, y, @x;
-END;
-open cur1;
-fetch cur1 into y;
-close cur1;
-CALL nonsexist();
-set @v1 = @x;
-set @v2 = y;
-END//
-CALL sp1();
-x y @x
-NULL a 3
-Warnings:
-Warning 1265 Data truncated for column 'y' at row 3
-Warning 1265 Data truncated for column 'y' at row 1
-SELECT @v1, @v2;
-@v1 @v2
-4 a
-DROP PROCEDURE sp1;
-
-Testcase 4.2.28:
---------------------------------------------------------------------------------
-set @x=0;
-set @y=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set session sort_buffer_size = 10 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-set @x = 4;
-set @y = 3;
-set global sort_buffer_size = 2 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-set @@sort_buffer_size = 10 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-END//
-CALL sp1();
-@@sort_buffer_size
-10485760
-@@sort_buffer_size
-10485760
-@@sort_buffer_size
-10485760
-SELECT @x, @y;
-@x @y
-4 3
-
-Testcase 4.2.29:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx char default 'x';
-declare xy char default 'y';
-declare xz char default 'z';
-set @xx = xx, @xy = xy;
-set @xz = xz;
-SELECT @xx, @xy, @xz;
-END//
-CALL sp1();
-@xx @xy @xz
-x y z
-DROP PROCEDURE sp1;
-
-Testcase 4.2.30:
---------------------------------------------------------------------------------
-set @xx=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx int;
-set xx = 'asd';
-set @xx = xx;
-SELECT @xx;
-END//
-CALL sp1();
-@xx
-0
-Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx int;
-set xx = 5;
-set @xx = xx;
-SELECT @xx;
-END//
-CALL sp1();
-@xx
-5
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - a:
---------------------------------------------------------------------------------
-set @xx=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx char;
-set xx = 'temp';
-set @xx = xx;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
-SELECT @xx;
-@xx
-t
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - b:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx float;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0
-Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx float;
-set xx = 1.6;
-SELECT xx;
-END//
-CALL sp1();
-xx
-1.6
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - c:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx datetime;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0000-00-00 00:00:00
-Warnings:
-Warning 1264 Out of range value for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx datetime;
-set xx = '2006-06-06 01:01:01';
-SELECT xx;
-END//
-CALL sp1();
-xx
-2006-06-06 01:01:01
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - d:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx varchar(20);
-set xx = "abcdefghijk";
-SELECT xx;
-END//
-CALL sp1();
-xx
-abcdefghijk
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - e:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx tinyint;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0
-Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx tinyint;
-set xx = -125;
-SELECT xx;
-END//
-CALL sp1();
-xx
--125
-DROP PROCEDURE sp1;
-
-Testcase 4.2.37:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer;
-SELECT sal, f2 into x, y from t2 limit 1;
-set @x=x; set @y=y;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x char ascii;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinytext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x text;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumtext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x longtext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x blob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x longblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x binary;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x date;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x time;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x datetime;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x timestamp;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year(3);
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year(4);
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x enum("1enum", "2enum");
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x set("1set", "2set");
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.38:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare notable condition for sqlstate '42S02';
-declare continue handler for notable set @x2=1;
-set @x = 1;
-insert into t2(f1) values (1);
-set @x = 2;
-insert into t2(f1) values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.39:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42000';
-declare cond1 condition for sqlstate '23000';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values(1);
-END//
-ERROR 42000: Duplicate condition: cond1
-
-Testcase 4.2.41:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '1';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '1'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '12';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '12'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '1234';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '1234'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123456';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123456'
-
-Testcase 4.2.42:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'abcdefghi';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: 'abcdefghi'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42000test';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '42000test'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '00000@#$%^&';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '00000@#$%^&'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'null';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: 'null'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate ' ';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: ' '
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 1234567890;
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1234567890;
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '2005-03-03';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '2005-03-03'
-
-Testcase 4.2.43:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-expect failure, SQLSTATE 00000 is not an acceptable value
-for an SP's handler
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '00000';
-declare continue handler for cond1 set @var2 = 1;
-set @x=1;
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-ensure SP doesn't exist
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-
-Testcase 4.2.45:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare continue handler for sqlstate '23000' set @varr1 = 5;
-declare continue handler for sqlstate '23000' set @varr3 = 7;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare mycondition condition for sqlstate '23000';
-declare continue handler for mycondition set @varr3 = 7;
-declare continue handler for sqlstate '23000' set @varr3 = 7;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-
-Testcase 4.2.46:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '1' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '1'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '12' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '12'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '123' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '123'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '1234' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '1234'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '123456' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '123456'
-
-Testcase 4.2.47:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '42s0200test' set @var2 = 1;
-insert into tnull values( 1);
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '42s0200test'
-
-Testcase 4.2.48:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-This creation should fail, SQLSTATE 00000 is unacceptable
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '00000' set @var2 = 1;
-set @x=1;
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-Verify SP wasn't created
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTSsp1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTSsp1' at line 1
-
-Testcase 4.2.52:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare cur1 cursor for SELECT f1, f2 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newlf1, newf3, newsal;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Duplicate cursor: cur1
-
-Testcase 4.2.53:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, lf1, f3, f4 into @w, @x, @y, @z from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newlf1, newf3, newsal;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Cursor SELECT must not have INTO
-
-Testcase 4.2.54:
---------------------------------------------------------------------------------
-
-Testcase 4.2.55:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Undefined CURSOR: cur1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 0;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf3, newf4;
-set count = count - 1;
-END while;
-END;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is already open
-
-Testcase 4.2.56:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is already open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.57:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2;
-declare cur2 cursor for SELECT f1, f2 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur2;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.59:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-open cur1;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 10;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf3, newf4;
-set count = count - 1;
-END while;
-open cur1;
-close cur1;
-END;
-close cur1;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.60:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-close cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-close cur1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-open cur1;
-END;
-fetch cur1 into newf1, newf2, newf3, newf4;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.62:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf2 char(20);
-declare newf1 int1;
-declare cur1 cursor for SELECT f1, f3 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2;
-set @x = newf1;
-set @y = newf2;
-SELECT @x, @y;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-DROP PROCEDURE sp1;
-
-Testcase 4.2.63:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-close cur1;
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 0;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-open cur1;
-END;
-close cur1;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.64:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-BEGIN
-open cur1;
-start transaction;
-fetch cur1 into newf1, newf2, newf4, newf3;
-commit;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END;
-END//
-CALL sp1();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-DROP PROCEDURE sp1;
-
-Testcase 4.2.65:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-BEGIN
-open cur1;
-fetch cur1 into newf1, newf2, newf4, newf3;
-rollback;
-fetch cur1 into newf1, newf2, newf4, newf3;
-commit;
-END;
-END//
-CALL sp1();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-DROP PROCEDURE sp1;
-
-Testcase 4.2.66:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.67:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-# set count = count - 1;
-# while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-# set count = count - 1;
-# END while;
-END;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.70:
---------------------------------------------------------------------------------
-create table temp1( f1 char(20), f2 char(20), f3 int, f4 char(20) );
-create table temp2( f1 char(20), f2 char(20), f3 int, f4 char(20) );
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare newf21 char(20);
-declare newf22 char(20);
-declare newf23 char(20);
-declare newf24 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 7, 1;
-declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 15, 1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-BEGIN
-set count = 10;
-BEGIN
-open cur2;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-END;
-insert into temp1 values(newf1, newf2, newf4, newf3);
-close cur1;
-END;
-BEGIN
-set count = 10;
-while count > 0 do
-fetch cur2 into newf21, newf22, newf24, newf23;
-set count = count - 1;
-END while;
-END;
-insert into temp2 values(newf21, newf22, newf24, newf23);
-close cur2;
-END//
-CALL sp1();
-SELECT count(*) from temp1;
-count(*)
-1
-SELECT * from temp2;
-f1 f2 f3 f4
-NULL NULL NULL NULL
-DROP PROCEDURE sp1;
-drop table temp1;
-drop table temp2;
-
-Section 3.1.3 - Syntax checks for the stored procedure-specific flow control statements
-. IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.3.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP TABLE IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742(
-middleinitial CHAR, lastname VARCHAR(50),
-age_averylongfieldname_averylongname_1234569 INT, COMMENT VARCHAR(100))
-ENGINE=<engine_to_be_tested>;
-INSERT INTO res_t3_itisalongname_1381742_itsaverylongname_1381742
-VALUES('a', 'aaaaaaaaaabbbbbbbbc', 0, 'default');
-CREATE PROCEDURE sp1(a INT)
-BEGIN
-DECLARE itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx CHAR;
-DECLARE itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx VARCHAR(100);
-DECLARE itisjustamediumsizeintintegervariablename INTEGER;
-SET itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx = 'b';
-SET itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx
-= 'oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@%';
-SET itisjustamediumsizeintintegervariablename = 5;
-SET @comment='a';
-label1: LOOP
-IF a > 100 THEN
-SET @comment = 'value of a is greater than 100';
-ELSEIF a < 100 THEN
-IF a < 50 THEN
-SET @comment = 'value of a is less than 50';
-ELSEIF a < 25 THEN
-SET @comment = 'value of a is less than 25';
-ELSE
-SET @comment = 'value of a is greater than 50 and less than 100';
-END IF;
-ELSE
-SET @comment = 'value of a is 100';
-END IF;
-IF itisjustamediumsizeintintegervariablename = 0 THEN LEAVE label1;
-END IF;
-INSERT INTO res_t3_itisalongname_1381742_itsaverylongname_1381742
-VALUES(itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx,
-CONCAT(itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx,
-' ', a), a, @comment);
-SET itisjustamediumsizeintintegervariablename
-= itisjustamediumsizeintintegervariablename - 1;
-ITERATE label1;
-END LOOP label1;
-END//
-CALL sp1(101);
-CALL sp1(100);
-CALL sp1(75);
-CALL sp1(40);
-CALL sp1(20);
-CALL sp1(-1);
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742
-ORDER BY middleinitial, lastname, age_averylongfieldname_averylongname_1234569;
-middleinitial lastname age_averylongfieldname_averylongname_1234569 COMMENT
-a aaaaaaaaaabbbbbbbbc 0 default
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE sp1;
-
-Testcase 4.3.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( action char(20) )
-BEGIN
-declare v1 char(20);
-declare v2 char(20);
-declare count integer;
-set v1 = 'f1';
-set v2 = 'address';
-set count = 1;
-case when action = 'delete' then
-insert into t3 values(v1, v2, count);
-delete from t3 where f1=v1;
-when action = 'insert' then
-repeat
-insert into t3 values(v1, v2, count);
-set count = count + 1;
-until count > 5
-END repeat;
-set count = 1;
-label1: repeat
-insert into t3 values(v1, v2, count);
-if count > 5 then leave label1;
-END if;
-set count = count + 1;
-until count > 5
-END repeat;
-set count = 1;
-while count < 5 do
-insert into t3 values(v1, v2, count);
-set count = count + 1;
-END while;
-set count = 1;
-label1: while count < 5 do
-insert into t3 values(v1, v2, count);
-if count > 5 then leave label1;
-END if;
-set count = count + 1;
-END while;
-else
-set @dummystring = 'temp value';
-END case;
-END//
-CALL sp2( 'insert' );
-SELECT * from t3 where f3 <=5 && f3 >= 0;
-f1 f2 f3
-f1 address 1
-f1 address 1
-f1 address 1
-f1 address 1
-f1 address 2
-f1 address 2
-f1 address 2
-f1 address 2
-f1 address 3
-f1 address 3
-f1 address 3
-f1 address 3
-f1 address 4
-f1 address 4
-f1 address 4
-f1 address 4
-f1 address 5
-f1 address 5
-SELECT count(*) from t3;
-count(*)
-28
-CALL sp2( 'delete' );
-SELECT count(*) from t3;
-count(*)
-10
-CALL sp2 ('test');
-SELECT @dummystring;
-@dummystring
-temp value
-DROP PROCEDURE sp2;
-
-Testcase 4.1.2:
----------------
-Ensure that all sub-clauses that should not be supported are disallowed with
-an appropriate error message. (case)
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp3;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742 (name char, address varchar(50), age_averylongfieldname_averylongname_1234569 smallint);
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-label1: case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsav' at line 3
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-label1: BEGIN
-case
-action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-END label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set' at line 5
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-then action = 'truncate' when
-truncate from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then action = 'truncate' when
-truncate from res_t3_itisalongname_1381742_itsave' at line 6
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-declare v1 char(20);
-declare v2 char(20);
-declare count integer;
-set v1 = 'f1';
-set v2= 'address';
-set count = 1;
-case action
-when 'delete' then
-when 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_13' at line 11
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-declare count int default 1;
-declare done int default 0;
-declare continue handler for sqlstate 'HY000' set done=1;
-label1: loop
-case
-when action = 'delete' then
-label3:BEGIN
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-END label3;
-when action = 'insert' then
-label2: while count < 10 do
-BEGIN
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742
-values('xxxxxxxxxxxxxxxxxxx', '1231230981(*&(*&)(*&(', count);
-set count = count + 1;
-if count= 10 then
-set done=1;
-END if;
-END;
-END while label2;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-if done=1 then
-leave label1;
-END if;
-END loop label1;
-SELECT count, done;
-END//
-CALL sp3('insert');
-count done
-10 1
-Warnings:
-Warning 1265 Data truncated for column 'name' at row 1
-Warning 1265 Data truncated for column 'name' at row 2
-Warning 1265 Data truncated for column 'name' at row 3
-Warning 1265 Data truncated for column 'name' at row 4
-Warning 1265 Data truncated for column 'name' at row 5
-Warning 1265 Data truncated for column 'name' at row 6
-Warning 1265 Data truncated for column 'name' at row 7
-Warning 1265 Data truncated for column 'name' at row 8
-Warning 1265 Data truncated for column 'name' at row 9
-DROP PROCEDURE sp3;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-if count > 10 then leave label1;
-else
-set count = count + 1;
-elseif count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-EN' at line 9
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-else
-set count = count + 1;
-if count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else
-set count = count + 1;
-if count > 20 then
-leave label1;
-END if;
-iterate lab' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-elseif count > 20 then
-leave label1;
-else
-set count=count+1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif count > 20 then
-leave label1;
-else
-set count=count+1;
-END if;
-iterate lab' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-END if;
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END if;
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare i int default 10;
-if i > 20 then
-set i=25;
-END if
-declare count int;
-set count = 1;
-label1: loop
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare count int;
-set count = 1;
-label1: loop
-if count > 20 then
-leave label1;
-' at line 7
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare idummy int default 10;
-declare count int;
-set count = 1;
-label1: loop
-BEGIN
-if count < 20 then
-BEGIN
-declare idummy2 int default 10;
-set count=count+1;
-END;
-else
-BEGIN
-SELECT idummy2;
-leave label1;
-END;
-END if;
-iterate label1;
-END;
-END loop label1;
-END//
-CALL sp4();
-ERROR 42S22: Unknown column 'idummy2' in 'field list'
-DROP PROCEDURE sp4;
-
-Testcase 4.3.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5()
-BEGIN
-declare count integer default 1;
-set count = 1;
-case
-else
-set count = 10;
-when count = 1 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else
-set count = 10;
-when count = 1 then
-set count = count + 1;
-END case;
-END' at line 6
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-when case count = 1 then
-set count = 10;
-when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when case count = 1 then
-set count = 10;
-when count = 2 then
-set count = count' at line 3
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-END case;
-when count = 1 then
-set count = 10;
-when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case;
-when count = 1 then
-set count = 10;
-when count = 2 then
-set count = coun' at line 3
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-when count = 1 then
-set count = 10;
-case when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when count = 1 then
-set count = 10;
-case when count = 2 then
-set count = count' at line 3
-
-Testcase 4.3.6:
----------------
-Ensure that all supported sub-clauses are supported only in the correct order (repeat).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-until count1 > 5
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat;
-until count1 > 5
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: until count1 > 5
-repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'until count1 > 5
-repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1' at line 4
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: END repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-until count1 > 5
-repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-unt' at line 4
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-until count1 > 10;
-SELECT count1;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-SELECT count1;
-END repeat;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1-1;
-until count1 < 0
-END repeat label1;
-SELECT count1;
-END//
-CALL sp6();
-count1
--1
-DROP PROCEDURE sp6;
-
-Testcase 4.3.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: loop
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-label1 iterate;
-END label1 loop;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate;
-END label1 loop;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: END loop;
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-iterate label1;
-loop;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END loop;
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END ' at line 3
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: iterate label1;
-loop
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate label1;
-loop
-set @dummystring = 'temp value';
-if count > 10 then leave l' at line 3
-
-Testcase 4.3.8:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-do while v1 > 0
-set v1 = v1 - 1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while v1 > 0
-set v1 = v1 - 1;
-END while;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-do v1 > 0 while
-set v1 = v1 - 1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while
-set v1 = v1 - 1;
-END while;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-END while;
-set v1 = v1 - 1;
-while v1 > 0 do;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while;
-set v1 = v1 - 1;
-while v1 > 0 do;
-END' at line 4
-
-Testcase 4.3.12:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp12;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp12( )
-BEGIN
-declare count1 integer default 1;
-declare count2 int;
-label1: loop
-if count1 > 2 then leave label1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-label2: loop
-if count2 > 2 then leave label2;
-END if;
-set count2 = count2 + 1;
-END loop label1;
-set count1 = count1 + 1;
-iterate label1;
-END loop label2;
-END//
-ERROR 42000: End-label label1 without match
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.13:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp13;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp13( )
-BEGIN
-declare count1 integer default 1;
-lable1: loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop;
-END//
-CALL sp13();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 1
-xyz pqr 2
-DROP PROCEDURE sp13;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.14:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp14;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp14( )
-BEGIN
-declare count1 integer default 1;
-loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop label1;
-END//
-ERROR 42000: LEAVE with no matching label: lable1
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.15:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp15;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp15( )
-BEGIN
-declare count1 integer default 1;
-label1 loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1' at line 4
-
-Testcase 4.3.16:
-----------------
-Ensure that every beginning label with the same scope must be unique.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp16;
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE PROCEDURE sp16( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-set count2 = 1;
-label1: repeat
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( xyz , pqr, count1);
-until count2 > 3
-END repeat label1;
-until count1 > 3
-END repeat label1;
-END//
-ERROR 42000: Redefining label label1
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-declare count3 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-label1: repeat
-set count2 = count2 + 1;
-SELECT count2;
-until count2 > 3
-END repeat label1;
-SELECT count1;
-until count1 > 3
-END repeat label1;
-label1: repeat
-set count3 = count3 + 1;
-SELECT count3;
-until count3 > 3
-END repeat label1;
-END//
-ERROR 42000: Redefining label label1
-
-Testcase 4.3.17:
---------------------------------------------------------------------------------
-
-Testcase 4.3.18:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp18;
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE PROCEDURE sp18( )
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat label2;
-END//
-ERROR 42000: End-label label2 without match
-
-Testcase 4.3.19:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp19;
-CREATE PROCEDURE sp19( )
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat;
-END//
-CALL sp19();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-DROP PROCEDURE sp19;
-
-Testcase 4.3.20:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp20;
-CREATE PROCEDURE sp20( )
-BEGIN
-declare count1 integer default 1;
-repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'label1;
-END' at line 8
-
-Testcase 4.3.21:
---------------------------------------------------------------------------------
-
-Testcase 4.3.22:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-label1: while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while label2;
-END while;
-END//
-ERROR 42000: End-label label2 without match
-
-Testcase 4.3.23:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while label1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'label1;
-END while;
-END' at line 11
-
-Testcase 4.3.25:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-label1: while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while;
-END while;
-END//
-CALL sp25 ();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-xyz pqr 2
-xyz pqr 3
-xyz pqr 3
-DROP PROCEDURE sp25;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Section 3.1.4 - Checks for the global nature of stored procedures:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.4.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP DATABASE IF EXISTS d40401;
-CREATE PROCEDURE sp1 ( n char(20) )
-BEGIN
-SELECT n;
-END//
-CREATE DATABASE d40401;
-USE d40401;
-CALL db_storedproc.sp1('abcd');
-n
-abcd
-USE db_storedproc;
-DROP PROCEDURE sp1;
-DROP DATABASE d40401;
-
-Testcase 4.4.2:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-DROP FUNCTION IF EXISTS fn11;
-DROP DATABASE IF EXISTS d40402;
-CREATE FUNCTION fn1(n int) returns int
-BEGIN
-declare a int;
-set a = 9 * n;
-return a;
-END//
-CREATE DATABASE d40402;
-USE d40402;
-SELECT db_storedproc.fn1(100);
-db_storedproc.fn1(100)
-900
-SELECT db_storedproc.fn1(1000);
-db_storedproc.fn1(1000)
-9000
-CREATE FUNCTION db_storedproc.fn11(n int) returns int
-BEGIN
-declare a int;
-set a = 9 * n;
-return a;
-END//
-SELECT db_storedproc.fn11(100);
-db_storedproc.fn11(100)
-900
-SELECT db_storedproc.fn11(1000);
-db_storedproc.fn11(1000)
-9000
-USE db_storedproc;
-DROP FUNCTION fn1;
-DROP FUNCTION fn11;
-DROP DATABASE d40402;
-
-Testcase 4.4.3:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-DROP DATABASE IF EXISTS d2;
-CREATE DATABASE d1;
-CREATE DATABASE d2;
-USE d1;
-create table res_t41(a char(5), b char(10));
-insert into res_t41 values('abcde', 'a!@#$%^&*(');
-USE d2;
-create table res_t42(a char(5), b char(10));
-USE d1;
-CREATE PROCEDURE sp2(n char (20))
-BEGIN
-SELECT res_t41.a, res_t41.b into @a, @b from res_t41 where res_t41.b = n;
-insert into d2.res_t42 values (@a, @b);
-END//
-USE d2;
-CALL d1.sp2('a!@#$%^&*(');
-show warnings;
-Level Code Message
-SELECT * from d1.res_t41;
-a b
-abcde a!@#$%^&*(
-SELECT * from res_t42;
-a b
-abcde a!@#$%^&*(
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE d2;
-
-Testcase 4.4.4:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-CREATE PROCEDURE sp3()
-BEGIN
-USE d1;
-END//
-ERROR 0A000: USE is not allowed in stored procedures
-USE db_storedproc;
-DROP DATABASE d1;
-
-Testcase 4.4.5:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-create table t43(a char(5), b char(10));
-insert into t43 values('abcde', 'a!@#$%^&*(');
-CREATE PROCEDURE d1.sp4()
-SELECT * from d1.t43;
-SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43
-USE db_storedproc;
-DROP DATABASE d1;
-CREATE DATABASE d1;
-USE d1;
-create table t44(a char(5), b char(10));
-SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-USE db_storedproc;
-DROP DATABASE d1;
-
-Testcase 4.4.6:
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5()
-SELECT * from db_storedproc.t4 limit 0, 10;
-SELECT db from mysql.proc where specific_name = 'sp5';
-db
-db_storedproc
-DROP PROCEDURE sp5;
-
-Testcase 4.4.7:
---------------------------------------------------------------------------------
-USE db_storedproc;
-drop table IF EXISTS t46;
-DROP PROCEDURE IF EXISTS sp6;
-create table t46(f1 char(20), f2 char(20));
-insert into t46 values ('abcd', 'wxyz');
-CREATE PROCEDURE db_storedproc.sp6()
-SELECT * from db_storedproc.t4 limit 0, 10;
-SELECT db from mysql.proc where specific_name = 'sp6';
-db
-db_storedproc
-drop table t46;
-DROP PROCEDURE sp6;
-
-Testcase 4.4.8:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-DROP DATABASE IF EXISTS d2;
-CREATE DATABASE d1;
-CREATE DATABASE d2;
-USE d1;
-CREATE PROCEDURE sp8 ( n char(20) ) sql security definer comment 'initial'
- SELECT * from t1 where t1.f1 = n;
-USE d2;
-alter procedure d1.sp8 sql security definer comment 'updated';
-SELECT * from mysql.proc where specific_name='sp8' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created NO_ENGINE_SUBSTITUTION updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
-
-Testcase 4.4.9:
---------------------------------------------------------------------------------
-USE d1;
-DROP FUNCTION IF EXISTS fn1;
-DROP FUNCTION IF EXISTS fn11;
-CREATE FUNCTION d1.fn2(n int) returns int sql security invoker comment 'initial'
-BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END//
-USE d2;
-alter function d1.fn2 sql security definer comment 'updated';
-SELECT * from mysql.proc where specific_name='fn2' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 fn2 FUNCTION fn2 SQL CONTAINS_SQL NO DEFINER n int int(11) BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END root@localhost modified created NO_ENGINE_SUBSTITUTION updated latin1 latin1_swedish_ci latin1_swedish_ci BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END
-
-Testcase 4.4.10:
---------------------------------------------------------------------------------
-USE d1;
-CREATE PROCEDURE sp9 ( n char(20) )
-SELECT * from t1 where t1.f1 = n;
-USE d2;
-DROP PROCEDURE d1.sp9;
-SELECT * from mysql.proc where specific_name='sp9' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.4.11:
---------------------------------------------------------------------------------
-USE d1;
-CREATE FUNCTION d1.fn3(n int) returns int
-BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END//
-USE d2;
-DROP FUNCTION d1.fn3;
-SELECT * from mysql.proc where specific_name='fn3' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE d2;
-
-Section 3.1.5 - Parameter use checks:
-Functions with all data types
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 bigint) returns bigint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn1(-9.22e+18);
-fn1(-9.22e+18)
--9220000000000000000
-DROP FUNCTION IF EXISTS fn2;
-CREATE FUNCTION fn2( f1 bigint unsigned) returns bigint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn2(1.84e+19);
-fn2(1.84e+19)
-18400000000000000000
-DROP FUNCTION IF EXISTS fn3;
-CREATE FUNCTION fn3( f1 bigint unsigned zerofill) returns bigint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn3(1.84e+17);
-fn3(1.84e+17)
-184000000000000000
-DROP FUNCTION IF EXISTS fn4;
-CREATE FUNCTION fn4( f1 bigint zerofill) returns bigint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn4(-9.22e+15);
-fn4(-9.22e+15)
-0
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn5;
-CREATE FUNCTION fn5( f1 decimal) returns decimal
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn5(-1.00e+09);
-fn5(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn6;
-CREATE FUNCTION fn6( f1 decimal (0)) returns decimal (0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn6(-1.00e+09);
-fn6(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn7;
-CREATE FUNCTION fn7( f1 decimal (0) unsigned) returns decimal (0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn7(99999999999);
-fn7(99999999999)
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn8;
-CREATE FUNCTION fn8( f1 decimal (0) unsigned zerofill) returns decimal (0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn8(999999999);
-fn8(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn9;
-CREATE FUNCTION fn9( f1 decimal (0) zerofill) returns decimal (0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn9(-1.00e+09);
-fn9(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn10;
-CREATE FUNCTION fn10( f1 decimal (0, 0)) returns decimal (0, 0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn10(-1.00e+09);
-fn10(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn11;
-CREATE FUNCTION fn11( f1 decimal (0, 0) unsigned) returns decimal (0, 0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn11(99999999999);
-fn11(99999999999)
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn12;
-CREATE FUNCTION fn12( f1 decimal (0, 0) unsigned zerofill) returns decimal (0, 0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn12(999999999);
-fn12(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn13;
-CREATE FUNCTION fn13( f1 decimal (0, 0) zerofill) returns decimal (0, 0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn13(-1.00e+09);
-fn13(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn14;
-CREATE FUNCTION fn14( f1 decimal (63, 30)) returns decimal (63, 30)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn14(-1.00e+21);
-fn14(-1.00e+21)
--1000000000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn15;
-CREATE FUNCTION fn15( f1 decimal (63, 30) unsigned) returns decimal (63, 30) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn15(1.00e+16);
-fn15(1.00e+16)
-10000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn16;
-CREATE FUNCTION fn16( f1 decimal (63, 30) unsigned zerofill) returns decimal (63, 30) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn16(1.00e+16);
-fn16(1.00e+16)
-000000000000000010000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn17;
-CREATE FUNCTION fn17( f1 decimal (63, 30) zerofill) returns decimal (63, 30) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn17(-1.00e+21);
-fn17(-1.00e+21)
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn18_d;
-CREATE FUNCTION fn18_d( f1 decimal (64)) returns decimal (64)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn18_d( -1000000000000000000000000000000 );
-fn18_d( -1000000000000000000000000000000 )
--1000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn19_du;
-CREATE FUNCTION fn19_du( f1 decimal (64) unsigned) returns decimal (64) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn19_du( 100000000000000000000 );
-fn19_du( 100000000000000000000 )
-100000000000000000000
-DROP FUNCTION IF EXISTS fn20_duz;
-CREATE FUNCTION fn20_duz( f1 decimal (64) unsigned zerofill) returns decimal (64) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn20_duz( 1000000000000000000000000 );
-fn20_duz( 1000000000000000000000000 )
-0000000000000000000000000000000000000001000000000000000000000000
-DROP FUNCTION IF EXISTS fn21_d_z;
-CREATE FUNCTION fn21_d_z( f1 decimal (64) zerofill) returns decimal (64) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn21_d_z(1.00e+00);
-fn21_d_z(1.00e+00)
-0000000000000000000000000000000000000000000000000000000000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn22;
-CREATE FUNCTION fn22( f1 decimal unsigned) returns decimal unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn22(1.00e+00);
-fn22(1.00e+00)
-10
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn23;
-CREATE FUNCTION fn23( f1 decimal unsigned zerofill) returns decimal unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn23(1.00e+00);
-fn23(1.00e+00)
-0000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn24;
-CREATE FUNCTION fn24( f1 decimal zerofill) returns decimal zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn24(-1.00e+09);
-fn24(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn25;
-CREATE FUNCTION fn25( f1 double) returns double
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn25(1.00e+00);
-fn25(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn26;
-CREATE FUNCTION fn26( f1 double unsigned) returns double unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn26(1.00e+00);
-fn26(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn27;
-CREATE FUNCTION fn27( f1 double unsigned zerofill) returns double unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn27(1.00e+00);
-fn27(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn28;
-CREATE FUNCTION fn28( f1 double zerofill) returns double zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn28(1.00e+00);
-fn28(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn29;
-CREATE FUNCTION fn29( f1 float) returns float
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn29(1.00e+00);
-fn29(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn30;
-CREATE FUNCTION fn30( f1 float unsigned) returns float unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn30(1.00e+00);
-fn30(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn31;
-CREATE FUNCTION fn31( f1 float unsigned zerofill) returns float unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn31(1.00e+00);
-fn31(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn32;
-CREATE FUNCTION fn32( f1 float zerofill) returns float zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn32(1.00e+00);
-fn32(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn33;
-CREATE FUNCTION fn33( f1 float(0)) returns float(0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn33(1.00e+00);
-fn33(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn34;
-CREATE FUNCTION fn34( f1 float(0) unsigned) returns float(0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn34(1.00e+00);
-fn34(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn35;
-CREATE FUNCTION fn35( f1 float(0) unsigned zerofill) returns float(0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn35(1.00e+00);
-fn35(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn36;
-CREATE FUNCTION fn36( f1 float(0) zerofill) returns float(0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn36(1.00e+00);
-fn36(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn37;
-CREATE FUNCTION fn37( f1 float(23)) returns float(23)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn37(1.00e+00);
-fn37(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn38;
-CREATE FUNCTION fn38( f1 float(23) unsigned) returns float(23) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn38(1.00e+00);
-fn38(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn39;
-CREATE FUNCTION fn39( f1 float(23) unsigned zerofill) returns float(23) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn39(1.00e+00);
-fn39(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn40;
-CREATE FUNCTION fn40( f1 float(23) zerofill) returns float(23) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn40(1.00e+00);
-fn40(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn41;
-CREATE FUNCTION fn41( f1 float(24)) returns float(24)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn41(1.00e+00);
-fn41(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn42;
-CREATE FUNCTION fn42( f1 float(24) unsigned) returns float(24) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn42(1.00e+00);
-fn42(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn43;
-CREATE FUNCTION fn43( f1 float(24) unsigned zerofill) returns float(24) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn43(1.00e+00);
-fn43(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn44;
-CREATE FUNCTION fn44( f1 float(24) zerofill) returns float(24) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn44(1.00e+00);
-fn44(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn45;
-CREATE FUNCTION fn45( f1 float(53)) returns float(53)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn45(1.00e+00);
-fn45(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn46;
-CREATE FUNCTION fn46( f1 float(53) unsigned) returns float(53) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn46(1.00e+00);
-fn46(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn47;
-CREATE FUNCTION fn47( f1 float(53) unsigned zerofill) returns float(53) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn47(1.00e+00);
-fn47(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn48;
-CREATE FUNCTION fn48( f1 float(53) zerofill) returns float(53) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn48(1.00e+00);
-fn48(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn49;
-CREATE FUNCTION fn49( f1 int) returns int
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn49(-2.15e+09);
-fn49(-2.15e+09)
--2147483638
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn50;
-CREATE FUNCTION fn50( f1 int unsigned) returns int unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn50(4.29e+09);
-fn50(4.29e+09)
-4290000000
-DROP FUNCTION IF EXISTS fn51;
-CREATE FUNCTION fn51( f1 int unsigned zerofill) returns int unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn51(4.29e+09);
-fn51(4.29e+09)
-4290000000
-DROP FUNCTION IF EXISTS fn52;
-CREATE FUNCTION fn52( f1 int zerofill) returns int zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn52(2.15e+08);
-fn52(2.15e+08)
-215000000
-DROP FUNCTION IF EXISTS fn53;
-CREATE FUNCTION fn53( f1 mediumint) returns mediumint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn53(-8388600);
-fn53(-8388600)
--8388598
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn54;
-CREATE FUNCTION fn54( f1 mediumint unsigned) returns mediumint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn54(16777201);
-fn54(16777201)
-16777202
-DROP FUNCTION IF EXISTS fn55;
-CREATE FUNCTION fn55( f1 mediumint unsigned zerofill) returns mediumint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn55(16777210);
-fn55(16777210)
-16777210
-DROP FUNCTION IF EXISTS fn56;
-CREATE FUNCTION fn56( f1 mediumint zerofill) returns mediumint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn56(-8388601);
-fn56(-8388601)
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn57;
-CREATE FUNCTION fn57( f1 numeric) returns numeric
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn57(-999999999);
-fn57(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn58;
-CREATE FUNCTION fn58( f1 numeric (0)) returns numeric (0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn58(-999999999);
-fn58(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn59;
-CREATE FUNCTION fn59( f1 numeric (0) unsigned) returns numeric (0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn59(9999999999);
-fn59(9999999999)
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn60;
-CREATE FUNCTION fn60( f1 numeric (0) unsigned zerofill) returns numeric (0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn60(99999999);
-fn60(99999999)
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn61;
-CREATE FUNCTION fn61( f1 numeric (0) zerofill) returns numeric (0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn61(-99999999);
-fn61(-99999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn62;
-CREATE FUNCTION fn62( f1 numeric (0, 0)) returns numeric (0, 0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn62(-999999999);
-fn62(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn63;
-CREATE FUNCTION fn63( f1 numeric (0, 0) unsigned) returns numeric (0, 0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn63(9999999999);
-fn63(9999999999)
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn64;
-CREATE FUNCTION fn64( f1 numeric (0, 0) unsigned zerofill) returns numeric (0, 0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn64(99999999);
-fn64(99999999)
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn65;
-CREATE FUNCTION fn65( f1 numeric (0, 0) zerofill) returns numeric (0, 0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn65(-99999999);
-fn65(-99999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn66;
-CREATE FUNCTION fn66( f1 numeric (63, 30)) returns numeric (63, 30)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn66(-1e+36);
-fn66(-1e+36)
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn67;
-CREATE FUNCTION fn67( f1 numeric (63, 30) unsigned) returns numeric (63, 30) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn67(1e+36);
-fn67(1e+36)
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn68;
-CREATE FUNCTION fn68( f1 numeric (63, 30) unsigned zerofill) returns numeric (63, 30) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn68(1e+36);
-fn68(1e+36)
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn69;
-CREATE FUNCTION fn69( f1 numeric (63, 30) zerofill) returns numeric (63, 30) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn69(-1e+36);
-fn69(-1e+36)
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn70_n;
-CREATE FUNCTION fn70_n( f1 numeric (64)) returns numeric (64)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn70_n( -1000000000000000000000000000000 );
-fn70_n( -1000000000000000000000000000000 )
--1000000000000000000000000000000
-SELECT fn70_n( -10000000000000000000000000000000000000000 );
-fn70_n( -10000000000000000000000000000000000000000 )
--10000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn71_nu;
-CREATE FUNCTION fn71_nu( f1 numeric (64) unsigned) returns numeric (64) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn71_nu( 10000000000000000000000000000000000000000 );
-fn71_nu( 10000000000000000000000000000000000000000 )
-10000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn72_nuz;
-CREATE FUNCTION fn72_nuz( f1 numeric (64) unsigned zerofill) returns numeric (64) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn72_nuz( 10000000000000000000000000000000000000000 );
-fn72_nuz( 10000000000000000000000000000000000000000 )
-0000000000000000000000010000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn73_n_z;
-CREATE FUNCTION fn73_n_z( f1 numeric (64) zerofill) returns numeric (64) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn73_n_z( 10000000000000000000000000000000000000000 );
-fn73_n_z( 10000000000000000000000000000000000000000 )
-0000000000000000000000010000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn74;
-CREATE FUNCTION fn74( f1 numeric unsigned) returns numeric unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn74(999999999);
-fn74(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn75;
-CREATE FUNCTION fn75( f1 numeric unsigned zerofill) returns numeric unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn75(999999999);
-fn75(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn76;
-CREATE FUNCTION fn76( f1 numeric zerofill) returns numeric zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn76(-999999999);
-fn76(-999999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn77;
-CREATE FUNCTION fn77( f1 real) returns real
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn77(1.1);
-fn77(1.1)
-1.1
-DROP FUNCTION IF EXISTS fn78;
-CREATE FUNCTION fn78( f1 real unsigned) returns real unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn78(1.1);
-fn78(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn79;
-CREATE FUNCTION fn79( f1 real unsigned zerofill) returns real unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn79(1.1);
-fn79(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn80;
-CREATE FUNCTION fn80( f1 real zerofill) returns real zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn80(1.1);
-fn80(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn81;
-CREATE FUNCTION fn81( f1 smallint) returns smallint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn81(-32701);
-fn81(-32701)
--32702
-DROP FUNCTION IF EXISTS fn82;
-CREATE FUNCTION fn82( f1 smallint unsigned) returns smallint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn82(65531);
-fn82(65531)
-65532
-DROP FUNCTION IF EXISTS fn83;
-CREATE FUNCTION fn83( f1 smallint unsigned zerofill) returns smallint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn83(65531);
-fn83(65531)
-65532
-DROP FUNCTION IF EXISTS fn84;
-CREATE FUNCTION fn84( f1 smallint zerofill) returns smallint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn84(-32601);
-fn84(-32601)
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn85;
-CREATE FUNCTION fn85( f1 tinyint) returns tinyint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn85(-115);
-fn85(-115)
--116
-DROP FUNCTION IF EXISTS fn86;
-CREATE FUNCTION fn86( f1 tinyint unsigned) returns tinyint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn86(251);
-fn86(251)
-252
-DROP FUNCTION IF EXISTS fn87;
-CREATE FUNCTION fn87( f1 tinyint unsigned zerofill) returns tinyint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn87(201);
-fn87(201)
-202
-DROP FUNCTION IF EXISTS fn88;
-CREATE FUNCTION fn88( f1 tinyint zerofill) returns tinyint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn88(-101);
-fn88(-101)
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn89;
-CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
-BEGIN
-IF f1 = '1enum' THEN
-SET f1 = '2enum';
-ELSE
-SET f1 = '1enum';
-END IF;
-RETURN f1;
-END//
-SELECT fn89( '1enum');
-fn89( '1enum')
-2enum
-DROP FUNCTION IF EXISTS fn90;
-CREATE FUNCTION fn90( f1 set('1set', '2set')) returns set('1set', '2set')
-BEGIN
-IF f1 = '1set' THEN
-SET f1 = '2set';
-ELSE
-SET f1 = '1set';
-END IF;
-RETURN f1;
-END//
-SELECT fn90( '1set');
-fn90( '1set')
-2set
-DROP FUNCTION IF EXISTS fn91;
-CREATE FUNCTION fn91( f1 date) returns date
-BEGIN
-set f1 = adddate(f1, interval 31 day);
-return f1;
-END//
-SELECT fn91('1997-12-31');
-fn91('1997-12-31')
-1998-01-31
-DROP FUNCTION IF EXISTS fn92;
-CREATE FUNCTION fn92( f1 time) returns time
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998');
-return f1;
-END//
-SELECT fn92( '23:59:59.999999');
-fn92( '23:59:59.999999')
-25:59:59
-DROP FUNCTION IF EXISTS fn93;
-CREATE FUNCTION fn93( f1 datetime) returns datetime
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002');
-return f1;
-END//
-SELECT fn93('1997-12-31 23:59:59.999999');
-fn93('1997-12-31 23:59:59.999999')
-1998-01-02 01:01:00
-DROP FUNCTION IF EXISTS fn94;
-CREATE FUNCTION fn94( f1 char) returns char
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn94( 'h');
-fn94( 'h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn95;
-CREATE FUNCTION fn95( f1 char ascii) returns char ascii
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn95('h');
-fn95('h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn96;
-CREATE FUNCTION fn96( f1 binary) returns binary(2)
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn96( 'h');
-fn96( 'h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn97;
-CREATE FUNCTION fn97( f1 longtext) returns longtext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn97( 'world');
-fn97( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn98;
-CREATE FUNCTION fn98( f1 mediumtext) returns mediumtext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn98( 'world');
-fn98( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn99;
-CREATE FUNCTION fn99( f1 text) returns text
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn99( 'world');
-fn99( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn100;
-CREATE FUNCTION fn100( f1 tinytext) returns tinytext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn100( 'world');
-fn100( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn101;
-CREATE FUNCTION fn101( f1 year) returns year
-BEGIN
-set f1 = f1 + 10;
-return f1;
-END//
-SELECT fn101(51);
-fn101(51)
-2061
-DROP FUNCTION IF EXISTS fn102;
-CREATE FUNCTION fn102( f1 year(4)) returns year(4)
-BEGIN
-set f1 = f1 + 51;
-return f1;
-END//
-SELECT fn102(1982);
-fn102(1982)
-2033
-DROP FUNCTION IF EXISTS fn103;
-CREATE FUNCTION fn103( f1 geometrycollection) returns geometrycollection
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\
-
-DROP FUNCTION IF EXISTS fn104;
-CREATE FUNCTION fn104( f1 linestring) returns linestring
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@')
-
-DROP FUNCTION IF EXISTS fn105;
-CREATE FUNCTION fn105( f1 point) returns point
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@');
-fn105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@')
-
-DROP FUNCTION IF EXISTS fn106;
-CREATE FUNCTION fn106( f1 polygon) returns polygon
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\
-
-DROP FUNCTION IF EXISTS fn107;
-CREATE FUNCTION fn107( f1 timestamp) returns timestamp
-BEGIN
-set f1 = now();
-return f1;
-END//
-SELECT fn107(20050510080451);
-fn107(20050510080451)
-returned
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-USE db1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp1(-9.22e+18);
-f1
--9220000000000000000
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( f1 bigint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp2(1.84e+19);
-f1
-18400000000000000000
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( f1 bigint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp3(1.84e+17);
-f1
-00184000000000000000
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4( f1 bigint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp4(-9.22e+15);
-f1
-00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5( f1 decimal)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp5(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( f1 decimal (0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp6(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7( f1 decimal (0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp7(99999999999);
-f1
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp8(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp9;
-CREATE PROCEDURE sp9( f1 decimal (0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp9(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp10;
-CREATE PROCEDURE sp10( f1 decimal (0, 0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp10(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp11;
-CREATE PROCEDURE sp11( f1 decimal (0, 0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp11(99999999999);
-f1
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp12;
-CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp12(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp13;
-CREATE PROCEDURE sp13( f1 decimal (0, 0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp13(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp14;
-CREATE PROCEDURE sp14( f1 decimal (63, 30))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp14(-1.00e+21);
-f1
--1000000000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp15;
-CREATE PROCEDURE sp15( f1 decimal (63, 30) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp15(1.00e+16);
-f1
-10000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( f1 decimal (63, 30) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp16(1.00e+16);
-f1
-000000000000000010000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp17;
-CREATE PROCEDURE sp17( f1 decimal (63, 30) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp17(-1.00e+21);
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp18_d;
-CREATE PROCEDURE sp18_d( f1 decimal (64))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp18_d(-1.00e+30);
-f1
--1000000000000000000000000000000
-CALL sp18_d( -1000000000000000000000000000000 );
-f1
--1000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp19_du;
-CREATE PROCEDURE sp19_du( f1 decimal (64) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp19_du(1.00e+20);
-f1
-100000000000000000000
-CALL sp19_du( 100000000000000000000 );
-f1
-100000000000000000000
-CALL sp19_du(1.00e+24);
-f1
-1000000000000000000000000
-CALL sp19_du( 1000000000000000000000000 );
-f1
-1000000000000000000000000
-DROP PROCEDURE IF EXISTS sp20_duz;
-CREATE PROCEDURE sp20_duz( f1 decimal (64) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp20_duz(1.00e+20);
-f1
-0000000000000000000000000000000000000000000100000000000000000000
-CALL sp20_duz( 100000000000000000000 );
-f1
-0000000000000000000000000000000000000000000100000000000000000000
-CALL sp20_duz(1.00e+24);
-f1
-0000000000000000000000000000000000000001000000000000000000000000
-CALL sp20_duz( 1000000000000000000000000 );
-f1
-0000000000000000000000000000000000000001000000000000000000000000
-DROP PROCEDURE IF EXISTS sp21;
-CREATE PROCEDURE sp21( f1 decimal (64) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp21(1.00e+00);
-f1
-0000000000000000000000000000000000000000000000000000000000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( f1 decimal unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp22(1.00e+00);
-f1
-10
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp23(1.00e+00);
-f1
-0000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp24;
-CREATE PROCEDURE sp24( f1 decimal zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp24(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( f1 double)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp25(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp26;
-CREATE PROCEDURE sp26( f1 double unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp26(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp27;
-CREATE PROCEDURE sp27( f1 double unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp27(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp28;
-CREATE PROCEDURE sp28( f1 double zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp28(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp29;
-CREATE PROCEDURE sp29( f1 float)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp29(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp30;
-CREATE PROCEDURE sp30( f1 float unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp30(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp31;
-CREATE PROCEDURE sp31( f1 float unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp31(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp32;
-CREATE PROCEDURE sp32( f1 float zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp32(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp33;
-CREATE PROCEDURE sp33( f1 float(0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp33(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp34;
-CREATE PROCEDURE sp34( f1 float(0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp34(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp35;
-CREATE PROCEDURE sp35( f1 float(0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp35(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp36;
-CREATE PROCEDURE sp36( f1 float(0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp36(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp37;
-CREATE PROCEDURE sp37( f1 float(23))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp37(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp38;
-CREATE PROCEDURE sp38( f1 float(23) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp38(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp39;
-CREATE PROCEDURE sp39( f1 float(23) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp39(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp40;
-CREATE PROCEDURE sp40( f1 float(23) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp40(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp41;
-CREATE PROCEDURE sp41( f1 float(24))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp41(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp42;
-CREATE PROCEDURE sp42( f1 float(24) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp42(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp43;
-CREATE PROCEDURE sp43( f1 float(24) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp43(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp44;
-CREATE PROCEDURE sp44( f1 float(24) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp44(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp45;
-CREATE PROCEDURE sp45( f1 float(53))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp45(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp46;
-CREATE PROCEDURE sp46( f1 float(53) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp46(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp47;
-CREATE PROCEDURE sp47( f1 float(53) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp47(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp48;
-CREATE PROCEDURE sp48( f1 float(53) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp48(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp49;
-CREATE PROCEDURE sp49( f1 int)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp49(-2.15e+09);
-f1
--2147483638
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp50;
-CREATE PROCEDURE sp50( f1 int unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp50(4.29e+09);
-f1
-4290000000
-DROP PROCEDURE IF EXISTS sp51;
-CREATE PROCEDURE sp51( f1 int unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp51(4.29e+09);
-f1
-4290000000
-DROP PROCEDURE IF EXISTS sp52;
-CREATE PROCEDURE sp52( f1 int zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp52(2.15e+08);
-f1
-0215000000
-DROP PROCEDURE IF EXISTS sp53;
-CREATE PROCEDURE sp53( f1 mediumint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp53(-8388600);
-f1
--8388598
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp54;
-CREATE PROCEDURE sp54( f1 mediumint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp54(16777201);
-f1
-16777202
-DROP PROCEDURE IF EXISTS sp55;
-CREATE PROCEDURE sp55( f1 mediumint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp55(16777210);
-f1
-16777210
-DROP PROCEDURE IF EXISTS sp56;
-CREATE PROCEDURE sp56( f1 mediumint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp56(-8388601);
-f1
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp57;
-CREATE PROCEDURE sp57( f1 numeric)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp57(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp58;
-CREATE PROCEDURE sp58( f1 numeric (0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp58(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp59;
-CREATE PROCEDURE sp59( f1 numeric (0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp59(9999999999);
-f1
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp60;
-CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp60(99999999);
-f1
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp61;
-CREATE PROCEDURE sp61( f1 numeric (0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp61(-99999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp62;
-CREATE PROCEDURE sp62( f1 numeric (0, 0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp62(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp63;
-CREATE PROCEDURE sp63( f1 numeric (0, 0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp63(9999999999);
-f1
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp64;
-CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp64(99999999);
-f1
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp65;
-CREATE PROCEDURE sp65( f1 numeric (0, 0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp65(-99999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp66_n;
-CREATE PROCEDURE sp66_n( f1 numeric (63, 30))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp66_n(-1e+36);
-f1
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp66_n( -1000000000000000000000000000000000000 );
-f1
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp67_nu;
-CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp67_nu(1e+36);
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp67_nu( 1000000000000000000000000000000000000 );
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp68_nuz;
-CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp68_nuz(1e+36);
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp68_nuz( 1000000000000000000000000000000000000 );
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp69_n_z;
-CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp69_n_z(-1e+36);
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp69_n_z( -1000000000000000000000000000000000000 );
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp70_n;
-CREATE PROCEDURE sp70_n( f1 numeric (64))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp70_n(-1e+40);
-f1
--10000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp70_n( -10000000000000000000000000000000000000000 );
-f1
--10000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp71_nu;
-CREATE PROCEDURE sp71_nu( f1 numeric (64) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp71_nu(1.00e+40);
-f1
-10000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp71_nu( 10000000000000000000000000000000000000000 );
-f1
-10000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp72_nuz;
-CREATE PROCEDURE sp72_nuz( f1 numeric (64) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp72_nuz(1.00e+40);
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp72_nuz( 10000000000000000000000000000000000000000 );
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp73_n_z;
-CREATE PROCEDURE sp73_n_z( f1 numeric (64) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp73_n_z(1.00e+40);
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp73_n_z( 10000000000000000000000000000000000000000 );
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp74;
-CREATE PROCEDURE sp74( f1 numeric unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp74(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp75;
-CREATE PROCEDURE sp75( f1 numeric unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp75(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp76;
-CREATE PROCEDURE sp76( f1 numeric zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp76(-999999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp77;
-CREATE PROCEDURE sp77( f1 real)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp77(1.1);
-f1
-1.1
-DROP PROCEDURE IF EXISTS sp78;
-CREATE PROCEDURE sp78( f1 real unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp78(1.1);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp79;
-CREATE PROCEDURE sp79( f1 real unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp79(1.1);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp80;
-CREATE PROCEDURE sp80( f1 real zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp80(1.1);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp81;
-CREATE PROCEDURE sp81( f1 smallint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp81(-32701);
-f1
--32702
-DROP PROCEDURE IF EXISTS sp82;
-CREATE PROCEDURE sp82( f1 smallint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp82(65531);
-f1
-65532
-DROP PROCEDURE IF EXISTS sp83;
-CREATE PROCEDURE sp83( f1 smallint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp83(65531);
-f1
-65532
-DROP PROCEDURE IF EXISTS sp84;
-CREATE PROCEDURE sp84( f1 smallint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp84(-32601);
-f1
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp85;
-CREATE PROCEDURE sp85( f1 tinyint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp85(-115);
-f1
--116
-DROP PROCEDURE IF EXISTS sp86;
-CREATE PROCEDURE sp86( f1 tinyint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp86(251);
-f1
-252
-DROP PROCEDURE IF EXISTS sp87;
-CREATE PROCEDURE sp87( f1 tinyint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp87(201);
-f1
-202
-DROP PROCEDURE IF EXISTS sp88;
-CREATE PROCEDURE sp88( f1 tinyint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp88(-101);
-f1
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp89;
-CREATE PROCEDURE sp89( f1 enum('1enum', '2enum'))
-BEGIN
-IF f1 = '1enum' THEN set f1 = '2enum'; ELSE set f1 = '1enum'; END IF;
-END//
-CALL sp89( '1enum');
-DROP PROCEDURE IF EXISTS sp90;
-CREATE PROCEDURE sp90( f1 set('1set', '2set'))
-BEGIN
-IF f1 = '1set' THEN set f1 = '2set'; ELSE set f1 = '1set'; END IF;
-END//
-CALL sp90( '1set');
-DROP PROCEDURE IF EXISTS sp91;
-CREATE PROCEDURE sp91( f1 date)
-BEGIN
-set f1 = adddate(f1, interval 31 day);
-SELECT f1;
-END//
-CALL sp91( '1997-12-31');
-f1
-1998-01-31
-DROP PROCEDURE IF EXISTS sp92;
-CREATE PROCEDURE sp92( f1 time)
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998');
-SELECT f1;
-END//
-CALL sp92( '23:59:59.999999');
-f1
-25:59:59
-DROP PROCEDURE IF EXISTS sp93;
-CREATE PROCEDURE sp93( f1 datetime)
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002');
-SELECT f1;
-END//
-CALL sp93('1997-12-31 23:59:59.999999');
-f1
-1998-01-02 01:01:00
-DROP PROCEDURE IF EXISTS sp94;
-CREATE PROCEDURE sp94( f1 char)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp94( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp95;
-CREATE PROCEDURE sp95( f1 char ascii)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp95( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp96;
-CREATE PROCEDURE sp96( f1 char binary)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp96( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp97;
-CREATE PROCEDURE sp97( f1 longtext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp97( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp98;
-CREATE PROCEDURE sp98( f1 mediumtext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp98( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp99;
-CREATE PROCEDURE sp99( f1 text)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp99( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp100;
-CREATE PROCEDURE sp100( f1 tinytext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp100( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp101;
-CREATE PROCEDURE sp101( f1 year)
-BEGIN
-set f1 = f1 + 10;
-SELECT f1;
-END//
-CALL sp101(51);
-f1
-2061
-DROP PROCEDURE IF EXISTS sp102;
-CREATE PROCEDURE sp102( f1 year(4))
-BEGIN
-set f1 = f1 + 51;
-SELECT f1;
-END//
-CALL sp102(1982);
-f1
-2033
-DROP PROCEDURE IF EXISTS sp103;
-CREATE PROCEDURE sp103( f1 geometrycollection)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp104;
-CREATE PROCEDURE sp104( f1 linestring)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp105;
-CREATE PROCEDURE sp105( f1 point)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@');
-f1
-
-DROP PROCEDURE IF EXISTS sp106;
-CREATE PROCEDURE sp106( f1 polygon)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp107;
-CREATE PROCEDURE sp107( f1 timestamp)
-BEGIN
-set f1 = now() + 0 + f1;
-SELECT f1;
-END//
-CALL sp107(2.00e+13);
-f1
-returned
-Warnings:
-returned 1265 Data truncated for column 'f1' at row 1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-USE db1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( in f1 year, inout f2 year, out f3 year, in f4 year,
-inout f5 year, out f6 year, in f7 year(4), inout f8 year(4),
-out f9 year(4), in f10 year(4), inout f11 year(4), out f12 year(4))
-BEGIN
-set f1 = f1 + 10; set f2 = f2 + 10; set f3 = f2 + 10;
-set f4 = f4 + 10; set f5 = f5 + 10; set f6 = f5 + 10;
-set f7 = f7 + 51; set f8 = f8 + 51; set f9 = f8 + 51;
-set f10 = f10 + 51; set f11 = f11 + 51; set f12 = f11 + 51;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute01;
-CREATE PROCEDURE spexecute01()
-BEGIN
-declare var1 year;
-declare var2 year;
-declare var3 year;
-declare var4 year;
-declare var5 year(4);
-declare var6 year(4);
-declare var7 year(4);
-declare var8 year(4);
-set var1 = 51;
-set var3 = 51;
-set var5 = 1982;
-set var7 = 1982;
-CALL sp1(51, var1, var2, 51, var3, var4, 1982, var5, var6, 1982, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute01();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2061 2061 2071 2061 2061 2071 2033 2033 2084 2033 2033 2084
-var1 var2 var3 var4 var5 var6 var7 var8
-2061 2071 2061 2071 2033 2084 2033 2084
-DROP PROCEDURE spexecute01;
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( in f1 text, inout f2 text, out f3 text, in f4 text, inout f5 text,
-out f6 text, in f7 tinytext, inout f8 tinytext, out f9 tinytext,
-in f10 tinytext, inout f11 tinytext, out f12 tinytext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute02;
-CREATE PROCEDURE spexecute02()
-BEGIN
-declare var1 text;
-declare var2 text;
-declare var3 text;
-declare var4 text;
-declare var5 tinytext;
-declare var6 tinytext;
-declare var7 tinytext;
-declare var8 tinytext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp2( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute02();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute02;
-DROP PROCEDURE sp2;
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( in f1 char, inout f2 char, out f3 char, in f4 char ascii,
-inout f5 char ascii, out f6 char ascii, in f7 longtext,
-inout f8 longtext, out f9 longtext, in f10 mediumtext,
-inout f11 mediumtext, out f12 mediumtext)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f1);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f4);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f9);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute03;
-CREATE PROCEDURE spexecute03()
-BEGIN
-declare var1 char;
-declare var2 char;
-declare var3 char ascii;
-declare var4 char ascii;
-declare var5 longtext;
-declare var6 longtext;
-declare var7 mediumtext;
-declare var8 mediumtext;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp3( 'h', var1, var2, 'h', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute03();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a helloworld helloworld NULL helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a helloworld NULL helloworld hellohelloworld
-DROP PROCEDURE spexecute03;
-DROP PROCEDURE sp3;
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4( in f1 bigint, inout f2 bigint, out f3 bigint,
-in f4 bigint, inout f5 bigint, out f6 bigint,
-in f7 bigint, inout f8 bigint, out f9 bigint,
-in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute04;
-CREATE PROCEDURE spexecute04()
-BEGIN
-declare var1 bigint;
-declare var2 bigint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -9.22e+18;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp4(-9.22e+18, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute04();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-6744073709551616 6744073709551616 -9220000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute04;
-DROP PROCEDURE sp4;
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( in f1 timestamp, inout f2 timestamp, out f3 timestamp, in f4 timestamp, inout f5 timestamp, out f6 timestamp, in f7 timestamp, inout f8 timestamp, out f9 timestamp, in f10 timestamp, inout f11 timestamp, out f12 timestamp)
-BEGIN
-set f1 = now() + 0 + f1; set f2 = now() + 0 + f2; set f3 = now() + 0 + f1;
-set f4 = now() + 0 + f4; set f5 = now() + 0 + f5; set f6 = now() + 0 + f5;
-set f7 = now() + 0 + f7; set f8 = now() + 0 + f8; set f9 = now() + 0 + f8;
-set f10 = now() + 0 + f10; set f11 = now() + 0 + f11; set f12 = now() + 0 + f11;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute06;
-CREATE PROCEDURE spexecute06()
-BEGIN
-declare var1 timestamp;
-declare var2 timestamp;
-declare var3 timestamp;
-declare var4 timestamp;
-declare var5 timestamp;
-declare var6 timestamp;
-declare var7 timestamp;
-declare var8 timestamp;
-set var1 = 2.00e+13;
-set var3 = 2.00e+13;
-set var5 = 2.00e+13;
-set var7 = 2.00e+13;
-CALL sp6(2.00e+13, var1, var2, 2.00e+13, var3, var4, 2.00e+13, var5, var6, 2.00e+13, var7, var8);
-END//
-CALL spexecute06();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-returned returned returned returned returned returned returned returned returned returned returned returned
-DROP PROCEDURE spexecute06;
-DROP PROCEDURE sp6;
-DROP PROCEDURE IF EXISTS sp07;
-CREATE PROCEDURE sp07( IN f1 BIGINT UNSIGNED,
-INOUT f2 BIGINT UNSIGNED,
-OUT f3 BIGINT UNSIGNED,
-IN f4 BIGINT,
-INOUT f5 BIGINT,
-OUT f6 BIGINT,
-IN f7 BIGINT,
-INOUT f8 BIGINT,
-OUT f9 BIGINT,
-IN f10 BIGINT,
-INOUT f11 BIGINT,
-OUT f12 BIGINT)
-BEGIN
-SELECT f1, f2, f3;
-SELECT f4, f5, f6;
-SELECT f7, f8, f9;
-SELECT f10, f11, f12;
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f3 * 2); set f3 = (f3 - 10); set f3 = (f3 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3;
-SELECT f4, f5, f6;
-SELECT f7, f8, f9;
-SELECT f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute07;
-CREATE PROCEDURE spexecute07()
-BEGIN
-declare var1 bigint unsigned;
-declare var2 bigint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.84e+19;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-SELECT var1, var2;
-SELECT var3, var4;
-SELECT var5, var6;
-SELECT var7, var8;
-CALL sp07( var1, var1, var2, var3, var3, var4,
-var5, var5, var6, var7, var7, var8 );
-SELECT var1, var2;
-SELECT var3, var4;
-SELECT var5, var6;
-SELECT var7, var8;
-END//
-CALL spexecute07();
-var1 var2
-18400000000000000000 NULL
-var3 var4
--9220000000000000000 NULL
-var5 var6
--9220000000000000000 NULL
-var7 var8
--9220000000000000000 NULL
-f1 f2 f3
-18400000000000000000 18400000000000000000 NULL
-f4 f5 f6
--9220000000000000000 -9220000000000000000 NULL
-f7 f8 f9
--9220000000000000000 -9220000000000000000 NULL
-f10 f11 f12
--9220000000000000000 -9220000000000000000 NULL
-f1 f2 f3
-18353255926290448384 18353255926290448384 18353255926290448384
-f4 f5 f6
--9220000000000000000 6744073709551616 6744073709551616
-f7 f8 f9
--9220000000000000000 6744073709551616 6744073709551616
-f10 f11 f12
--9220000000000000000 6744073709551616 6744073709551616
-var1 var2
-18353255926290448384 18353255926290448384
-var3 var4
-6744073709551616 6744073709551616
-var5 var6
-6744073709551616 6744073709551616
-var7 var8
-6744073709551616 6744073709551616
-DROP PROCEDURE spexecute07;
-DROP PROCEDURE sp07;
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8( in f1 bigint unsigned zerofill,
-inout f2 bigint unsigned zerofill,
-out f3 bigint unsigned zerofill,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute08;
-CREATE PROCEDURE spexecute08()
-BEGIN
-declare var1 bigint unsigned zerofill;
-declare var2 bigint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.84e+17;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp8(1.84e+17, var1, var2, -9.22e+18, var3, var4,
--9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute08();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00368000000000000000 00368000000000000000 00368000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00368000000000000000 00368000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute08;
-DROP PROCEDURE sp8;
-DROP PROCEDURE IF EXISTS sp9;
-CREATE PROCEDURE sp9( in f1 bigint zerofill,
-inout f2 bigint zerofill,
-out f3 bigint zerofill,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute09;
-CREATE PROCEDURE spexecute09()
-BEGIN
-declare var1 bigint zerofill;
-declare var2 bigint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -9.22e+15;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp9(-9.22e+15, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute09();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00000000000000000000 00000000000000000000 00000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00000000000000000000 00000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute09;
-DROP PROCEDURE sp9;
-DROP PROCEDURE IF EXISTS sp10;
-CREATE PROCEDURE sp10( in f1 decimal,
-inout f2 decimal,
-out f3 decimal,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute10;
-CREATE PROCEDURE spexecute10()
-BEGIN
-declare var1 decimal;
-declare var2 decimal;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp10(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute10();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute10;
-DROP PROCEDURE sp10;
-DROP PROCEDURE IF EXISTS sp11;
-CREATE PROCEDURE sp11( in f1 decimal (0), inout f2 decimal (0), out f3 decimal (0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute11;
-CREATE PROCEDURE spexecute11()
-BEGIN
-declare var1 decimal (0);
-declare var2 decimal (0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = --1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp11(--1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute11();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute11;
-DROP PROCEDURE sp11;
-DROP PROCEDURE IF EXISTS sp12;
-CREATE PROCEDURE sp12( in f1 decimal (0) unsigned, inout f2 decimal (0) unsigned, out f3 decimal (0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute12;
-CREATE PROCEDURE spexecute12()
-BEGIN
-declare var1 decimal (0) unsigned;
-declare var2 decimal (0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp12(99999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute12();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute12;
-DROP PROCEDURE sp12;
-DROP PROCEDURE IF EXISTS sp13;
-CREATE PROCEDURE sp13( in f1 decimal (0, 0) zerofill, inout f2 decimal (0, 0) zerofill, out f3 decimal (0, 0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute13;
-CREATE PROCEDURE spexecute13()
-BEGIN
-declare var1 decimal (0, 0) zerofill;
-declare var2 decimal (0, 0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp13(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute13();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute13;
-DROP PROCEDURE sp13;
-DROP PROCEDURE IF EXISTS sp14;
-CREATE PROCEDURE sp14( in f1 decimal (63, 30), inout f2 decimal (63, 30), out f3 decimal (63, 30), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute14;
-CREATE PROCEDURE spexecute14()
-BEGIN
-declare var1 decimal (63, 30);
-declare var2 decimal (63, 30);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+21;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp14(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute14();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000000000000000.000000000000000000000000000000 -1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute14;
-DROP PROCEDURE sp14;
-DROP PROCEDURE IF EXISTS sp15;
-CREATE PROCEDURE sp15( in f1 double, inout f2 double, out f3 double, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute15;
-CREATE PROCEDURE spexecute15()
-BEGIN
-declare var1 double;
-declare var2 double;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp15(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute15();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute15;
-DROP PROCEDURE sp15;
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( in f1 double zerofill, inout f2 double zerofill, out f3 double zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute16;
-CREATE PROCEDURE spexecute16()
-BEGIN
-declare var1 double zerofill;
-declare var2 double zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp16(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute16();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute16;
-DROP PROCEDURE sp16;
-DROP PROCEDURE IF EXISTS sp17;
-CREATE PROCEDURE sp17( in f1 double unsigned, inout f2 double unsigned, out f3 double unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute17;
-CREATE PROCEDURE spexecute17()
-BEGIN
-declare var1 double unsigned;
-declare var2 double unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp17(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute17();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute17;
-DROP PROCEDURE sp17;
-DROP PROCEDURE IF EXISTS sp18;
-CREATE PROCEDURE sp18( in f1 double unsigned zerofill, inout f2 double unsigned zerofill, out f3 double unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute18;
-CREATE PROCEDURE spexecute18()
-BEGIN
-declare var1 double unsigned zerofill;
-declare var2 double unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp18(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute18();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute18;
-DROP PROCEDURE sp18;
-DROP PROCEDURE IF EXISTS sp19;
-CREATE PROCEDURE sp19( in f1 float unsigned, inout f2 float unsigned, out f3 float unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute19;
-CREATE PROCEDURE spexecute19()
-BEGIN
-declare var1 float unsigned;
-declare var2 float unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp19(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute19();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute19;
-DROP PROCEDURE sp19;
-DROP PROCEDURE IF EXISTS sp20;
-CREATE PROCEDURE sp20( in f1 float unsigned zerofill, inout f2 float unsigned zerofill, out f3 float unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute20;
-CREATE PROCEDURE spexecute20()
-BEGIN
-declare var1 float unsigned zerofill;
-declare var2 float unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp20(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute20();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute20;
-DROP PROCEDURE sp20;
-DROP PROCEDURE IF EXISTS sp21;
-CREATE PROCEDURE sp21( in f1 float zerofill, inout f2 float zerofill, out f3 float zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute21;
-CREATE PROCEDURE spexecute21()
-BEGIN
-declare var1 float zerofill;
-declare var2 float zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp21(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute21();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute21;
-DROP PROCEDURE sp21;
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( in f1 float(0), inout f2 float(0), out f3 float(0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute22;
-CREATE PROCEDURE spexecute22()
-BEGIN
-declare var1 float(0);
-declare var2 float(0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp22(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute22();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute22;
-DROP PROCEDURE sp22;
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( in f1 numeric, inout f2 numeric, out f3 numeric, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute23;
-CREATE PROCEDURE spexecute23()
-BEGIN
-declare var1 numeric;
-declare var2 numeric;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp23(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute23();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute23;
-DROP PROCEDURE sp23;
-DROP PROCEDURE IF EXISTS sp24;
-CREATE PROCEDURE sp24( in f1 real, inout f2 real, out f3 real, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute24;
-CREATE PROCEDURE spexecute24()
-BEGIN
-declare var1 real;
-declare var2 real;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp24(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute24();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1.1 1.1 11.1 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1.1 11.1 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute24;
-DROP PROCEDURE sp24;
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( in f1 smallint, inout f2 smallint, out f3 smallint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute25;
-CREATE PROCEDURE spexecute25()
-BEGIN
-declare var1 smallint;
-declare var2 smallint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32701;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp25(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute25();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32758 -32758 -32748 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32758 -32748 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute25;
-DROP PROCEDURE sp25;
-DROP PROCEDURE IF EXISTS sp26;
-CREATE PROCEDURE sp26( in f1 date, inout f2 date, out f3 date, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = adddate(f1, interval 31 day); set f2 = adddate(f2, interval 31 day); set f3 = adddate(f2, interval 31 day);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute26;
-CREATE PROCEDURE spexecute26()
-BEGIN
-declare var1 date;
-declare var2 date;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '1997-12-31';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp26( '1997-12-31', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute26();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-31 1998-01-31 1998-03-03 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-31 1998-03-03 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute26;
-DROP PROCEDURE sp26;
-DROP PROCEDURE IF EXISTS sp27;
-CREATE PROCEDURE sp27( in f1 time, inout f2 time, out f3 time, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998'); set f2 = addtime(f2, '02:00:00.999998'); set f3 = addtime(f2, '02:00:00.999998');
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute27;
-CREATE PROCEDURE spexecute27()
-BEGIN
-declare var1 time;
-declare var2 time;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '23:59:59.999999';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp27( '23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute27();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-25:59:59 25:59:59 27:59:59 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-25:59:59 27:59:59 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute27;
-DROP PROCEDURE sp27;
-DROP PROCEDURE IF EXISTS sp28;
-CREATE PROCEDURE sp28( in f1 datetime, inout f2 datetime, out f3 datetime, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002'); set f2 = addtime(f2, '1 1:1:1.000002'); set f3 = addtime(f1, '1 1:1:1.000002');
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute28;
-CREATE PROCEDURE spexecute28()
-BEGIN
-declare var1 datetime;
-declare var2 datetime;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '1997-12-31 23:59:59.999999';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp28('1997-12-31 23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute28();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-02 01:01:00 1998-01-02 01:01:00 1998-01-03 02:02:01 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-02 01:01:00 1998-01-03 02:02:01 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute28;
-DROP PROCEDURE sp28;
-DROP PROCEDURE IF EXISTS sp29;
-CREATE PROCEDURE sp29( in f1 float(0) unsigned, inout f2 float(0) unsigned, out f3 float(0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute29;
-CREATE PROCEDURE spexecute29()
-BEGIN
-declare var1 float(0) unsigned;
-declare var2 float(0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp29(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute29();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute29;
-DROP PROCEDURE sp29;
-DROP PROCEDURE IF EXISTS sp30;
-CREATE PROCEDURE sp30( in f1 float(0) zerofill, inout f2 float(0) zerofill, out f3 float(0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute30;
-CREATE PROCEDURE spexecute30()
-BEGIN
-declare var1 float(0) zerofill;
-declare var2 float(0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp30(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute30();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute30;
-DROP PROCEDURE sp30;
-DROP PROCEDURE IF EXISTS sp31;
-CREATE PROCEDURE sp31( in f1 float(23), inout f2 float(23), out f3 float(23), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute31;
-CREATE PROCEDURE spexecute31()
-BEGIN
-declare var1 float(23);
-declare var2 float(23);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp31(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute31();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute31;
-DROP PROCEDURE sp31;
-DROP PROCEDURE IF EXISTS sp32;
-CREATE PROCEDURE sp32( in f1 float(23) unsigned, inout f2 float(23) unsigned, out f3 float(23) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute32;
-CREATE PROCEDURE spexecute32()
-BEGIN
-declare var1 float(23) unsigned;
-declare var2 float(23) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp32(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute32();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute32;
-DROP PROCEDURE sp32;
-DROP PROCEDURE IF EXISTS sp33;
-CREATE PROCEDURE sp33( in f1 float(23) zerofill, inout f2 float(23) zerofill, out f3 float(23) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute33;
-CREATE PROCEDURE spexecute33()
-BEGIN
-declare var1 float(23) zerofill;
-declare var2 float(23) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp33(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute33();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute33;
-DROP PROCEDURE sp33;
-DROP PROCEDURE IF EXISTS sp34;
-CREATE PROCEDURE sp34( in f1 float(24), inout f2 float(24), out f3 float(24), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute34;
-CREATE PROCEDURE spexecute34()
-BEGIN
-declare var1 float(24);
-declare var2 float(24);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp34(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute34();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute34;
-DROP PROCEDURE sp34;
-DROP PROCEDURE IF EXISTS sp35;
-CREATE PROCEDURE sp35( in f1 float(24) unsigned, inout f2 float(24) unsigned, out f3 float(24) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute35;
-CREATE PROCEDURE spexecute35()
-BEGIN
-declare var1 float(24) unsigned;
-declare var2 float(24) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp35(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute35();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute35;
-DROP PROCEDURE sp35;
-DROP PROCEDURE IF EXISTS sp36;
-CREATE PROCEDURE sp36( in f1 float(24) zerofill, inout f2 float(24) zerofill, out f3 float(24) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute36;
-CREATE PROCEDURE spexecute36()
-BEGIN
-declare var1 float(24) zerofill;
-declare var2 float(24) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp36(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute36();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute36;
-DROP PROCEDURE sp36;
-DROP PROCEDURE IF EXISTS sp37;
-CREATE PROCEDURE sp37( in f1 float(53), inout f2 float(53), out f3 float(53), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute37;
-CREATE PROCEDURE spexecute37()
-BEGIN
-declare var1 float(53);
-declare var2 float(53);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp37(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute37();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute37;
-DROP PROCEDURE sp37;
-DROP PROCEDURE IF EXISTS sp38;
-CREATE PROCEDURE sp38( in f1 float(53) unsigned, inout f2 float(53) unsigned, out f3 float(53) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute38;
-CREATE PROCEDURE spexecute38()
-BEGIN
-declare var1 float(53) unsigned;
-declare var2 float(53) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp38(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute38();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute38;
-DROP PROCEDURE sp38;
-DROP PROCEDURE IF EXISTS sp39;
-CREATE PROCEDURE sp39( in f1 float(53) zerofill, inout f2 float(53) zerofill, out f3 float(53) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute39;
-CREATE PROCEDURE spexecute39()
-BEGIN
-declare var1 float(53) zerofill;
-declare var2 float(53) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp39(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute39();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute39;
-DROP PROCEDURE sp39;
-DROP PROCEDURE IF EXISTS sp40;
-CREATE PROCEDURE sp40( in f1 real unsigned, inout f2 real unsigned, out f3 real unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute40;
-CREATE PROCEDURE spexecute40()
-BEGIN
-declare var1 real unsigned;
-declare var2 real unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp40(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute40();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute40;
-DROP PROCEDURE sp40;
-DROP PROCEDURE IF EXISTS sp41;
-CREATE PROCEDURE sp41( in f1 real unsigned zerofill, inout f2 real unsigned zerofill, out f3 real unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute41;
-CREATE PROCEDURE spexecute41()
-BEGIN
-declare var1 real unsigned zerofill;
-declare var2 real unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp41(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute41();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute41;
-DROP PROCEDURE sp41;
-DROP PROCEDURE IF EXISTS sp42;
-CREATE PROCEDURE sp42( in f1 real zerofill, inout f2 real zerofill, out f3 real zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute42;
-CREATE PROCEDURE spexecute42()
-BEGIN
-declare var1 real zerofill;
-declare var2 real zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp42(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute42();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute42;
-DROP PROCEDURE sp42;
-DROP PROCEDURE IF EXISTS sp43;
-CREATE PROCEDURE sp43( in f1 numeric (0), inout f2 numeric (0), out f3 numeric (0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute43;
-CREATE PROCEDURE spexecute43()
-BEGIN
-declare var1 numeric (0);
-declare var2 numeric (0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp43(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute43();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute43;
-DROP PROCEDURE sp43;
-DROP PROCEDURE IF EXISTS sp44;
-CREATE PROCEDURE sp44( in f1 numeric (0) unsigned, inout f2 numeric (0) unsigned, out f3 numeric (0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute44;
-CREATE PROCEDURE spexecute44()
-BEGIN
-declare var1 numeric (0) unsigned;
-declare var2 numeric (0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp44(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute44();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute44;
-DROP PROCEDURE sp44;
-DROP PROCEDURE IF EXISTS sp45;
-CREATE PROCEDURE sp45( in f1 numeric (0) zerofill, inout f2 numeric (0) zerofill, out f3 numeric (0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute45;
-CREATE PROCEDURE spexecute45()
-BEGIN
-declare var1 numeric (0) zerofill;
-declare var2 numeric (0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp45(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute45();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute45;
-DROP PROCEDURE sp45;
-DROP PROCEDURE IF EXISTS sp46;
-CREATE PROCEDURE sp46( in f1 numeric (0, 0), inout f2 numeric (0, 0), out f3 numeric (0, 0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute46;
-CREATE PROCEDURE spexecute46()
-BEGIN
-declare var1 numeric (0, 0);
-declare var2 numeric (0, 0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp46(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute46();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute46;
-DROP PROCEDURE sp46;
-DROP PROCEDURE IF EXISTS sp47;
-CREATE PROCEDURE sp47( in f1 numeric (0, 0) unsigned, inout f2 numeric (0, 0) unsigned, out f3 numeric (0, 0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute47;
-CREATE PROCEDURE spexecute47()
-BEGIN
-declare var1 numeric (0, 0) unsigned;
-declare var2 numeric (0, 0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp47(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute47();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute47;
-DROP PROCEDURE sp47;
-DROP PROCEDURE IF EXISTS sp48;
-CREATE PROCEDURE sp48( in f1 numeric (0, 0) zerofill, inout f2 numeric (0, 0) zerofill, out f3 numeric (0, 0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute48;
-CREATE PROCEDURE spexecute48()
-BEGIN
-declare var1 numeric (0, 0) zerofill;
-declare var2 numeric (0, 0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp48(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute48();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute48;
-DROP PROCEDURE sp48;
-DROP PROCEDURE IF EXISTS sp49;
-CREATE PROCEDURE sp49( in f1 numeric unsigned, inout f2 numeric unsigned, out f3 numeric unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute49;
-CREATE PROCEDURE spexecute49()
-BEGIN
-declare var1 numeric unsigned;
-declare var2 numeric unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp49(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute49();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute49;
-DROP PROCEDURE sp49;
-DROP PROCEDURE IF EXISTS sp50;
-CREATE PROCEDURE sp50( in f1 numeric unsigned zerofill, inout f2 numeric unsigned zerofill, out f3 numeric unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute50;
-CREATE PROCEDURE spexecute50()
-BEGIN
-declare var1 numeric unsigned zerofill;
-declare var2 numeric unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp50(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute50();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute50;
-DROP PROCEDURE sp50;
-DROP PROCEDURE IF EXISTS sp51;
-CREATE PROCEDURE sp51( in f1 numeric zerofill, inout f2 numeric zerofill, out f3 numeric zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute51;
-CREATE PROCEDURE spexecute51()
-BEGIN
-declare var1 numeric zerofill;
-declare var2 numeric zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp51(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute51();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute51;
-DROP PROCEDURE sp51;
-DROP PROCEDURE IF EXISTS sp52;
-CREATE PROCEDURE sp52( in f1 numeric (63, 30), inout f2 numeric (63, 30), out f3 numeric (63, 30), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute52;
-CREATE PROCEDURE spexecute52()
-BEGIN
-declare var1 numeric (63, 30);
-declare var2 numeric (63, 30);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp52(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute52();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000.000000000000000000000000000000 -10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute52;
-DROP PROCEDURE sp52;
-DROP PROCEDURE IF EXISTS sp53;
-CREATE PROCEDURE sp53( in f1 numeric (64), inout f2 numeric (64), out f3 numeric (64), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute53;
-CREATE PROCEDURE spexecute53()
-BEGIN
-declare var1 numeric (64);
-declare var2 numeric (64);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp53(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute53();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute53;
-DROP PROCEDURE sp53;
-DROP PROCEDURE IF EXISTS sp54;
-CREATE PROCEDURE sp54( in f1 numeric (64) unsigned, inout f2 numeric (64) unsigned, out f3 numeric (64) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute54;
-CREATE PROCEDURE spexecute54()
-BEGIN
-declare var1 numeric (64) unsigned;
-declare var2 numeric (64) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp54(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute54();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute54;
-DROP PROCEDURE sp54;
-DROP PROCEDURE IF EXISTS sp55;
-CREATE PROCEDURE sp55( in f1 numeric (64) zerofill, inout f2 numeric (64) zerofill, out f3 numeric (64) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute55;
-CREATE PROCEDURE spexecute55()
-BEGIN
-declare var1 numeric (64) zerofill;
-declare var2 numeric (64) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp55(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute55();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute55;
-DROP PROCEDURE sp55;
-DROP PROCEDURE IF EXISTS sp56;
-CREATE PROCEDURE sp56( in f1 year, inout f2 year, out f3 year, in f4 year, inout f5 year, out f6 year, in f7 year, inout f8 year, out f9 year, in f10 year, inout f11 year, out f12 year)
-BEGIN
-set f1 = f1 + 10; set f2 = f2 + 10; set f3 = f2 + 10;
-set f4 = f4 + 10; set f5 = f5 + 10; set f6 = f5 + 10;
-set f7 = f7 + 10; set f8 = f8 + 10; set f9 = f8 + 10;
-set f10= f10+ 10; set f11 = f11 + 10; set f12 = f11 + 10;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute56;
-CREATE PROCEDURE spexecute56()
-BEGIN
-declare var1 year;
-declare var2 year;
-declare var3 year;
-declare var4 year;
-declare var5 year;
-declare var6 year;
-declare var7 year;
-declare var8 year;
-set var1 = 51;
-set var3 = 51;
-set var5 = 51;
-set var7 = 51;
-CALL sp56(51, var1, var2, 51, var3, var4, 51, var5, var6, 51, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute56();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2061 2061 2071 2061 2061 2071 2061 2061 2071 2061 2061 2071
-var1 var2 var3 var4 var5 var6 var7 var8
-2061 2071 2061 2071 2061 2071 2061 2071
-DROP PROCEDURE spexecute56;
-DROP PROCEDURE sp56;
-DROP PROCEDURE IF EXISTS sp57;
-CREATE PROCEDURE sp57( in f1 year(4), inout f2 year(4), out f3 year(4), in f4 year(4), inout f5 year(4), out f6 year(4), in f7 year(4), inout f8 year(4), out f9 year(4), in f10 year(4), inout f11 year(4), out f12 year(4))
-BEGIN
-set f1 = f1 + 51; set f2 = f2 + 51; set f3 = f2 + 51;
-set f4 = f4 + 51; set f5 = f5 + 51; set f6 = f5 + 51;
-set f7 = f7 + 51; set f8 = f8 + 51; set f9 = f8 + 51;
-set f10 = f10 + 51; set f11 = f11 + 51; set f12 = f11 + 51;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute57;
-CREATE PROCEDURE spexecute57()
-BEGIN
-declare var1 year(4);
-declare var2 year(4);
-declare var3 year(4);
-declare var4 year(4);
-declare var5 year(4);
-declare var6 year(4);
-declare var7 year(4);
-declare var8 year(4);
-set var1 = 1982;
-set var3 = 1982;
-set var5 = 1982;
-set var7 = 1982;
-CALL sp57(1982, var1, var2, 1982, var3, var4, 1982, var5, var6, 1982, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute57();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2033 2033 2084 2033 2033 2084 2033 2033 2084 2033 2033 2084
-var1 var2 var3 var4 var5 var6 var7 var8
-2033 2084 2033 2084 2033 2084 2033 2084
-DROP PROCEDURE spexecute57;
-DROP PROCEDURE sp57;
-DROP PROCEDURE IF EXISTS sp58;
-CREATE PROCEDURE sp58( in f1 text, inout f2 text, out f3 text, in f4 text, inout f5 text, out f6 text, in f7 text, inout f8 text, out f9 text, in f10 text, inout f11 text, out f12 text)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute58;
-CREATE PROCEDURE spexecute58()
-BEGIN
-declare var1 text;
-declare var2 text;
-declare var3 text;
-declare var4 text;
-declare var5 text;
-declare var6 text;
-declare var7 text;
-declare var8 text;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp58( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute58();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute58;
-DROP PROCEDURE sp58;
-DROP PROCEDURE IF EXISTS sp59;
-CREATE PROCEDURE sp59( in f1 tinytext, inout f2 tinytext, out f3 tinytext, in f4 tinytext, inout f5 tinytext, out f6 tinytext, in f7 tinytext, inout f8 tinytext, out f9 tinytext, in f10 tinytext, inout f11 tinytext, out f12 tinytext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute59;
-CREATE PROCEDURE spexecute59()
-BEGIN
-declare var1 tinytext;
-declare var2 tinytext;
-declare var3 tinytext;
-declare var4 tinytext;
-declare var5 tinytext;
-declare var6 tinytext;
-declare var7 tinytext;
-declare var8 tinytext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp59( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute59();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute59;
-DROP PROCEDURE sp59;
-DROP PROCEDURE IF EXISTS sp60;
-CREATE PROCEDURE sp60( in f1 char, inout f2 char, out f3 char, in f4 char, inout f5 char, out f6 char, in f7 char, inout f8 char, out f9 char, in f10 char, inout f11 char, out f12 char)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f1);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f5);
-set f7 = concat('a', f7); set f8 = concat('a', f8); set f9 = concat('a', f8);
-set f10 = concat('a', f10); set f11 = concat('a', f11); set f12 = concat('a', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute60;
-CREATE PROCEDURE spexecute60()
-BEGIN
-declare var1 char;
-declare var2 char;
-declare var3 char;
-declare var4 char;
-declare var5 char;
-declare var6 char;
-declare var7 char;
-declare var8 char;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'h';
-set var7 = 'h';
-CALL sp60( 'h', var1, var2, 'h', var3, var4, 'h', var5, var6, 'h', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute60();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a a a a a a a
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a a a a a
-DROP PROCEDURE spexecute60;
-DROP PROCEDURE sp60;
-DROP PROCEDURE IF EXISTS sp61;
-CREATE PROCEDURE sp61( in f1 char ascii, inout f2 char ascii, out f3 char ascii, in f4 char ascii, inout f5 char ascii, out f6 char ascii, in f7 char ascii, inout f8 char ascii, out f9 char ascii, in f10 char ascii, inout f11 char ascii, out f12 char ascii)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f2);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f4);
-set f7 = concat('a', f7); set f8 = concat('a', f8); set f9 = concat('a', f9);
-set f10 = concat('a', f10); set f11 = concat('a', f11); set f12 = concat('a', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute61;
-CREATE PROCEDURE spexecute61()
-BEGIN
-declare var1 char ascii;
-declare var2 char ascii;
-declare var3 char ascii;
-declare var4 char ascii;
-declare var5 char ascii;
-declare var6 char ascii;
-declare var7 char ascii;
-declare var8 char ascii;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'h';
-set var7 = 'h';
-CALL sp61( 'h', var1, var2, 'h', var3, var4, 'h', var5, var6, 'h', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute61();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a a a NULL a a a
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a a NULL a a
-DROP PROCEDURE spexecute61;
-DROP PROCEDURE sp61;
-DROP PROCEDURE IF EXISTS sp62;
-CREATE PROCEDURE sp62( in f1 longtext, inout f2 longtext, out f3 longtext, in f4 longtext, inout f5 longtext, out f6 longtext, in f7 longtext, inout f8 longtext, out f9 longtext, in f10 longtext, inout f11 longtext, out f12 longtext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute62;
-CREATE PROCEDURE spexecute62()
-BEGIN
-declare var1 longtext;
-declare var2 longtext;
-declare var3 longtext;
-declare var4 longtext;
-declare var5 longtext;
-declare var6 longtext;
-declare var7 longtext;
-declare var8 longtext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp62( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute62();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute62;
-DROP PROCEDURE sp62;
-DROP PROCEDURE IF EXISTS sp63;
-CREATE PROCEDURE sp63( in f1 mediumtext, inout f2 mediumtext, out f3 mediumtext, in f4 mediumtext, inout f5 mediumtext, out f6 mediumtext, in f7 mediumtext, inout f8 mediumtext, out f9 mediumtext, in f10 mediumtext, inout f11 mediumtext, out f12 mediumtext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f3);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute63;
-CREATE PROCEDURE spexecute63()
-BEGIN
-declare var1 mediumtext;
-declare var2 mediumtext;
-declare var3 mediumtext;
-declare var4 mediumtext;
-declare var5 mediumtext;
-declare var6 mediumtext;
-declare var7 mediumtext;
-declare var8 mediumtext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp63( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute63();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld NULL helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld NULL helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute63;
-DROP PROCEDURE sp63;
-DROP PROCEDURE IF EXISTS sp64;
-CREATE PROCEDURE sp64( in f1 decimal, inout f2 decimal, out f3 decimal, in f4 decimal, inout f5 decimal, out f6 decimal, in f7 decimal, inout f8 decimal, out f9 decimal, in f10 decimal, inout f11 decimal, out f12 decimal)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f4 = (f4 / 2); set f4 = (f4 * 2); set f4 = (f4 - 10); set f4 = (f4 + 10); set f5 = (f5 / 2); set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f5 / 2); set f6 = (f5 * 2); set f6 = (f5 - 10); set f6 = (f5 + 10);
-set f7 = (f7 / 2); set f7 = (f7 * 2); set f7 = (f7 - 10); set f7 = (f7 + 10); set f8 = (f8 / 2); set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f8 / 2); set f9 = (f8 * 2); set f9 = (f8 - 10); set f9 = (f8 + 10);
-set f10 = (f10 / 2); set f10 = (f10 * 2); set f10 = (f10 - 10); set f10 = (f10 + 10); set f11 = (f11 / 2); set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f11 / 2); set f12 = (f11 * 2); set f12 = (f11 - 10); set f12 = (f11 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute64;
-CREATE PROCEDURE spexecute64()
-BEGIN
-declare var1 decimal;
-declare var2 decimal;
-declare var3 decimal;
-declare var4 decimal;
-declare var5 decimal;
-declare var6 decimal;
-declare var7 decimal;
-declare var8 decimal;
-set var1 = --1.00e+09;
-set var3 = --1.00e+09;
-set var5 = --1.00e+09;
-set var7 = --1.00e+09;
-CALL sp64(--1.00e+09, var1, var2, --1.00e+09, var3, var4, --1.00e+09, var5, var6, --1.00e+09, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute64();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 1000000000 1000000000 1000000010 1000000000 1000000000 1000000010 1000000000 1000000000 1000000010
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 1000000000 1000000010 1000000000 1000000010 1000000000 1000000010
-DROP PROCEDURE spexecute64;
-DROP PROCEDURE sp64;
-DROP PROCEDURE IF EXISTS sp65;
-CREATE PROCEDURE sp65( in f1 decimal (0, 0) unsigned zerofill, inout f2 decimal (0, 0) unsigned zerofill, out f3 decimal (0, 0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute65;
-CREATE PROCEDURE spexecute65()
-BEGIN
-declare var1 decimal (0, 0) unsigned zerofill;
-declare var2 decimal (0, 0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp65(999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute65();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute65;
-DROP PROCEDURE sp65;
-DROP PROCEDURE IF EXISTS sp66;
-CREATE PROCEDURE sp66( in f1 decimal (63, 30) unsigned, inout f2 decimal (63, 30) unsigned, out f3 decimal (63, 30) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute66;
-CREATE PROCEDURE spexecute66()
-BEGIN
-declare var1 decimal (63, 30) unsigned;
-declare var2 decimal (63, 30) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+16;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp66(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute66();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10000000000000000.000000000000000000000000000000 10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute66;
-DROP PROCEDURE sp66;
-DROP PROCEDURE IF EXISTS sp67;
-CREATE PROCEDURE sp67( in f1 decimal (63, 30) unsigned zerofill, inout f2 decimal (63, 30) unsigned zerofill, out f3 decimal (63, 30) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute67;
-CREATE PROCEDURE spexecute67()
-BEGIN
-declare var1 decimal (63, 30) unsigned zerofill;
-declare var2 decimal (63, 30) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+16;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp67(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute67();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute67;
-DROP PROCEDURE sp67;
-DROP PROCEDURE IF EXISTS sp68;
-CREATE PROCEDURE sp68( in f1 decimal (63, 30) zerofill, inout f2 decimal (63, 30) zerofill, out f3 decimal (63, 30) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute68;
-CREATE PROCEDURE spexecute68()
-BEGIN
-declare var1 decimal (63, 30) zerofill;
-declare var2 decimal (63, 30) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+21;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp68(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute68();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute68;
-DROP PROCEDURE sp68;
-DROP PROCEDURE IF EXISTS sp69;
-CREATE PROCEDURE sp69( in f1 decimal (64), inout f2 decimal (64), out f3 decimal (64), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute69;
-CREATE PROCEDURE spexecute69()
-BEGIN
-declare var1 decimal (64);
-declare var2 decimal (64);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp69(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute69();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute69;
-DROP PROCEDURE sp69;
-DROP PROCEDURE IF EXISTS sp70;
-CREATE PROCEDURE sp70( in f1 decimal (64) unsigned, inout f2 decimal (64) unsigned, out f3 decimal (64) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute70;
-CREATE PROCEDURE spexecute70()
-BEGIN
-declare var1 decimal (64) unsigned;
-declare var2 decimal (64) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp70(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute70();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute70;
-DROP PROCEDURE sp70;
-DROP PROCEDURE IF EXISTS sp71;
-CREATE PROCEDURE sp71( in f1 decimal (64) unsigned zerofill, inout f2 decimal (64) unsigned zerofill, out f3 decimal (64) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute71;
-CREATE PROCEDURE spexecute71()
-BEGIN
-declare var1 decimal (64) unsigned zerofill;
-declare var2 decimal (64) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp71(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute71();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute71;
-DROP PROCEDURE sp71;
-DROP PROCEDURE IF EXISTS sp72;
-CREATE PROCEDURE sp72( in f1 decimal (64) zerofill, inout f2 decimal (64) zerofill, out f3 decimal (64) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute72;
-CREATE PROCEDURE spexecute72()
-BEGIN
-declare var1 decimal (64) zerofill;
-declare var2 decimal (64) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp72(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute72();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute72;
-DROP PROCEDURE sp72;
-DROP PROCEDURE IF EXISTS sp73;
-CREATE PROCEDURE sp73( in f1 decimal unsigned, inout f2 decimal unsigned, out f3 decimal unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute73;
-CREATE PROCEDURE spexecute73()
-BEGIN
-declare var1 decimal unsigned;
-declare var2 decimal unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp73(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute73();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute73;
-DROP PROCEDURE sp73;
-DROP PROCEDURE IF EXISTS sp74;
-CREATE PROCEDURE sp74( in f1 decimal unsigned zerofill, inout f2 decimal unsigned zerofill, out f3 decimal unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute74;
-CREATE PROCEDURE spexecute74()
-BEGIN
-declare var1 decimal unsigned zerofill;
-declare var2 decimal unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp74(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute74();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute74;
-DROP PROCEDURE sp74;
-DROP PROCEDURE IF EXISTS sp75;
-CREATE PROCEDURE sp75( in f1 decimal zerofill, inout f2 decimal zerofill, out f3 decimal zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute75;
-CREATE PROCEDURE spexecute75()
-BEGIN
-declare var1 decimal zerofill;
-declare var2 decimal zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp75(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute75();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute75;
-DROP PROCEDURE sp75;
-DROP PROCEDURE IF EXISTS sp76;
-CREATE PROCEDURE sp76( in f1 float(0) unsigned zerofill, inout f2 float(0) unsigned zerofill, out f3 float(0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute76;
-CREATE PROCEDURE spexecute76()
-BEGIN
-declare var1 float(0) unsigned zerofill;
-declare var2 float(0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp76(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute76();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute76;
-DROP PROCEDURE sp76;
-DROP PROCEDURE IF EXISTS sp77;
-CREATE PROCEDURE sp77( in f1 float(23) unsigned zerofill, inout f2 float(23) unsigned zerofill, out f3 float(23) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute77;
-CREATE PROCEDURE spexecute77()
-BEGIN
-declare var1 float(23) unsigned zerofill;
-declare var2 float(23) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp77(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute77();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute77;
-DROP PROCEDURE sp77;
-DROP PROCEDURE IF EXISTS sp78;
-CREATE PROCEDURE sp78( in f1 float(24) unsigned zerofill, inout f2 float(24) unsigned zerofill, out f3 float(24) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute78;
-CREATE PROCEDURE spexecute78()
-BEGIN
-declare var1 float(24) unsigned zerofill;
-declare var2 float(24) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp78(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute78();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute78;
-DROP PROCEDURE sp78;
-DROP PROCEDURE IF EXISTS sp79;
-CREATE PROCEDURE sp79( in f1 float(53) unsigned zerofill, inout f2 float(53) unsigned zerofill, out f3 float(53) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute79;
-CREATE PROCEDURE spexecute79()
-BEGIN
-declare var1 float(53) unsigned zerofill;
-declare var2 float(53) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp79(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute79();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute79;
-DROP PROCEDURE sp79;
-DROP PROCEDURE IF EXISTS sp80;
-CREATE PROCEDURE sp80( in f1 int, inout f2 int, out f3 int, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute80;
-CREATE PROCEDURE spexecute80()
-BEGIN
-declare var1 int;
-declare var2 int;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -2.15e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp80(-2.15e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute80();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--2147483638 -2147483638 -2147483628 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--2147483638 -2147483628 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute80;
-DROP PROCEDURE sp80;
-DROP PROCEDURE IF EXISTS sp81;
-CREATE PROCEDURE sp81( in f1 int unsigned, inout f2 int unsigned, out f3 int unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute81;
-CREATE PROCEDURE spexecute81()
-BEGIN
-declare var1 int unsigned;
-declare var2 int unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 4.29e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp81(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute81();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute81;
-DROP PROCEDURE sp81;
-DROP PROCEDURE IF EXISTS sp82;
-CREATE PROCEDURE sp82( in f1 int unsigned zerofill, inout f2 int unsigned zerofill, out f3 int unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute82;
-CREATE PROCEDURE spexecute82()
-BEGIN
-declare var1 int unsigned zerofill;
-declare var2 int unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 4.29e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp82(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute82();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute82;
-DROP PROCEDURE sp82;
-DROP PROCEDURE IF EXISTS sp83;
-CREATE PROCEDURE sp83( in f1 int zerofill, inout f2 int zerofill, out f3 int zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute83;
-CREATE PROCEDURE spexecute83()
-BEGIN
-declare var1 int zerofill;
-declare var2 int zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 2.15e+08;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp83(2.15e+08, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute83();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0215000000 0215000000 0215000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0215000000 0215000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute83;
-DROP PROCEDURE sp83;
-DROP PROCEDURE IF EXISTS sp84;
-CREATE PROCEDURE sp84( in f1 mediumint, inout f2 mediumint, out f3 mediumint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute84;
-CREATE PROCEDURE spexecute84()
-BEGIN
-declare var1 mediumint;
-declare var2 mediumint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -8388600;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp84(-8388600, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute84();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--8388598 -8388598 -8388588 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--8388598 -8388588 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute84;
-DROP PROCEDURE sp84;
-DROP PROCEDURE IF EXISTS sp85;
-CREATE PROCEDURE sp85( in f1 mediumint unsigned, inout f2 mediumint unsigned, out f3 mediumint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute85;
-CREATE PROCEDURE spexecute85()
-BEGIN
-declare var1 mediumint unsigned;
-declare var2 mediumint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 16777201;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp85(16777201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute85();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777202 16777202 16777212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777202 16777212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute85;
-DROP PROCEDURE sp85;
-DROP PROCEDURE IF EXISTS sp86;
-CREATE PROCEDURE sp86( in f1 mediumint unsigned zerofill, inout f2 mediumint unsigned zerofill, out f3 mediumint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute86;
-CREATE PROCEDURE spexecute86()
-BEGIN
-declare var1 mediumint unsigned zerofill;
-declare var2 mediumint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 16777210;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp86(16777210, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute86();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777210 16777210 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777210 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute86;
-DROP PROCEDURE sp86;
-DROP PROCEDURE IF EXISTS sp87;
-CREATE PROCEDURE sp87( in f1 mediumint zerofill, inout f2 mediumint zerofill, out f3 mediumint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute87;
-CREATE PROCEDURE spexecute87()
-BEGIN
-declare var1 mediumint zerofill;
-declare var2 mediumint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -8388601;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp87(-8388601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute87();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777215 16777215 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777215 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute87;
-DROP PROCEDURE sp87;
-DROP PROCEDURE IF EXISTS sp88;
-CREATE PROCEDURE sp88( in f1 numeric (0) unsigned zerofill, inout f2 numeric (0) unsigned zerofill, out f3 numeric (0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute88;
-CREATE PROCEDURE spexecute88()
-BEGIN
-declare var1 numeric (0) unsigned zerofill;
-declare var2 numeric (0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp88(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute88();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute88;
-DROP PROCEDURE sp88;
-DROP PROCEDURE IF EXISTS sp89;
-CREATE PROCEDURE sp89( in f1 numeric (0, 0) unsigned zerofill, inout f2 numeric (0, 0) unsigned zerofill, out f3 numeric (0, 0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute89;
-CREATE PROCEDURE spexecute89()
-BEGIN
-declare var1 numeric (0, 0) unsigned zerofill;
-declare var2 numeric (0, 0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp89(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute89();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute89;
-DROP PROCEDURE sp89;
-DROP PROCEDURE IF EXISTS sp90;
-CREATE PROCEDURE sp90( in f1 numeric (63, 30) unsigned, inout f2 numeric (63, 30) unsigned, out f3 numeric (63, 30) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute90;
-CREATE PROCEDURE spexecute90()
-BEGIN
-declare var1 numeric (63, 30) unsigned;
-declare var2 numeric (63, 30) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp90(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute90();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000.000000000000000000000000000000 10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute90;
-DROP PROCEDURE sp90;
-DROP PROCEDURE IF EXISTS sp91;
-CREATE PROCEDURE sp91( in f1 numeric (63, 30) unsigned zerofill, inout f2 numeric (63, 30) unsigned zerofill, out f3 numeric (63, 30) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute91;
-CREATE PROCEDURE spexecute91()
-BEGIN
-declare var1 numeric (63, 30) unsigned zerofill;
-declare var2 numeric (63, 30) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp91(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute91();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000100000000000000000000.000000000000000000000000000000 000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute91;
-DROP PROCEDURE sp91;
-DROP PROCEDURE IF EXISTS sp92;
-CREATE PROCEDURE sp92( in f1 numeric (63, 30) zerofill, inout f2 numeric (63, 30) zerofill, out f3 numeric (63, 30) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute92;
-CREATE PROCEDURE spexecute92()
-BEGIN
-declare var1 numeric (63, 30) zerofill;
-declare var2 numeric (63, 30) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp92(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute92();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute92;
-DROP PROCEDURE sp92;
-DROP PROCEDURE IF EXISTS sp93;
-CREATE PROCEDURE sp93( in f1 numeric (64) unsigned zerofill, inout f2 numeric (64) unsigned zerofill, out f3 numeric (64) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute93;
-CREATE PROCEDURE spexecute93()
-BEGIN
-declare var1 numeric (64) unsigned zerofill;
-declare var2 numeric (64) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp93(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute93();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute93;
-DROP PROCEDURE sp93;
-DROP PROCEDURE IF EXISTS sp94;
-CREATE PROCEDURE sp94( in f1 smallint, inout f2 smallint, out f3 smallint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute94;
-CREATE PROCEDURE spexecute94()
-BEGIN
-declare var1 smallint;
-declare var2 smallint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32701;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp94(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute94();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32702 -32702 -32692 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32702 -32692 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute94;
-DROP PROCEDURE sp94;
-DROP PROCEDURE IF EXISTS sp95;
-CREATE PROCEDURE sp95( in f1 smallint unsigned, inout f2 smallint unsigned, out f3 smallint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute95;
-CREATE PROCEDURE spexecute95()
-BEGIN
-declare var1 smallint unsigned;
-declare var2 smallint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 65531;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp95(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute95();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute95;
-DROP PROCEDURE sp95;
-DROP PROCEDURE IF EXISTS sp96;
-CREATE PROCEDURE sp96( in f1 smallint unsigned zerofill, inout f2 smallint unsigned zerofill, out f3 smallint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute96;
-CREATE PROCEDURE spexecute96()
-BEGIN
-declare var1 smallint unsigned zerofill;
-declare var2 smallint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 65531;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp96(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute96();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute96;
-DROP PROCEDURE sp96;
-DROP PROCEDURE IF EXISTS sp97;
-CREATE PROCEDURE sp97( in f1 smallint zerofill, inout f2 smallint zerofill, out f3 smallint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute97;
-CREATE PROCEDURE spexecute97()
-BEGIN
-declare var1 smallint zerofill;
-declare var2 smallint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32601;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp97(-32601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute97();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65535 65535 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65535 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute97;
-DROP PROCEDURE sp97;
-DROP PROCEDURE IF EXISTS sp98;
-CREATE PROCEDURE sp98( in f1 tinyint, inout f2 tinyint, out f3 tinyint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute98;
-CREATE PROCEDURE spexecute98()
-BEGIN
-declare var1 tinyint;
-declare var2 tinyint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -115;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp98(-115, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute98();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--116 -116 -106 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--116 -106 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute98;
-DROP PROCEDURE sp98;
-DROP PROCEDURE IF EXISTS sp99;
-CREATE PROCEDURE sp99( in f1 tinyint unsigned, inout f2 tinyint unsigned, out f3 tinyint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute99;
-CREATE PROCEDURE spexecute99()
-BEGIN
-declare var1 tinyint unsigned;
-declare var2 tinyint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 251;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp99(251, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute99();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-252 252 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-252 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute99;
-DROP PROCEDURE sp99;
-DROP PROCEDURE IF EXISTS sp100;
-CREATE PROCEDURE sp100( in f1 tinyint unsigned zerofill, inout f2 tinyint unsigned zerofill, out f3 tinyint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute100;
-CREATE PROCEDURE spexecute100()
-BEGIN
-declare var1 tinyint unsigned zerofill;
-declare var2 tinyint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 201;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp100(201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute100();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-202 202 212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-202 212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute100;
-DROP PROCEDURE sp100;
-DROP PROCEDURE IF EXISTS sp101;
-CREATE PROCEDURE sp101( in f1 tinyint zerofill, inout f2 tinyint zerofill, out f3 tinyint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute101;
-CREATE PROCEDURE spexecute101()
-BEGIN
-declare var1 tinyint zerofill;
-declare var2 tinyint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -101;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp101(-101, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute101();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-255 255 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-255 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute101;
-DROP PROCEDURE sp101;
-USE db_storedproc;
-DROP DATABASE db1;
-USE db_storedproc;
-
-Testcase 4.7.2:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for "allow_invalid_dates" server sql mode
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-drop table IF EXISTS temp_table;
-create table temp_table (f1 datetime);
-set @@sql_mode = 'allow_invalid_dates';
-CREATE PROCEDURE sp2 ()
-BEGIN
-declare a datetime;
-set a = '2005-03-14 01:01:02';
-insert into temp_table values(a);
-END//
-show CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 ALLOW_INVALID_DATES CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
-BEGIN
-declare a datetime;
-set a = '2005-03-14 01:01:02';
-insert into temp_table values(a);
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode = 'traditional';
-CALL sp2 ();
-SELECT * from temp_table;
-f1
-2005-03-14 01:01:02
-SELECT @@sql_mode;
-@@sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-DROP PROCEDURE sp2;
-drop table temp_table;
-
-Testcase 4.7.3:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for *high_not_precedence* server sql mode
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp3;
-set @@sql_mode = 'high_not_precedence';
-CREATE PROCEDURE sp3()
-BEGIN
-declare a int signed;
-declare b int unsigned;
-set a = -5;
-set b = 5;
-SELECT not 1 between a and b;
-END//
-show CREATE PROCEDURE sp3;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp3 HIGH_NOT_PRECEDENCE CREATE DEFINER=`root`@`localhost` PROCEDURE `sp3`()
-BEGIN
-declare a int signed;
-declare b int unsigned;
-set a = -5;
-set b = 5;
-SELECT not 1 between a and b;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-CALL sp3();
-not 1 between a and b
-1
-SELECT @@sql_mode;
-@@sql_mode
-
-DROP PROCEDURE sp3;
-
-Testcase 4.7.4:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for combination of server sql modes
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp4;
-set @@sql_mode = 'ansi, error_for_division_by_zero';
-ERROR 42000: Variable 'sql_mode' can't be set to the value of ' error_for_division_by_zero'
-set @@sql_mode = 'ansi,error_for_division_by_zero';
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO
-CREATE PROCEDURE sp4()
-BEGIN
-declare a int;
-declare b int;
-declare c int;
-set a = 0;
-set b = 1;
-set c = b/a;
-show warnings;
-END//
-show CREATE PROCEDURE sp4;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO CREATE DEFINER="root"@"localhost" PROCEDURE "sp4"()
-BEGIN
-declare a int;
-declare b int;
-declare c int;
-set a = 0;
-set b = 1;
-set c = b/a;
-show warnings;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-CALL sp4();
-Level Code Message
-Error 1365 Division by 0
-Warnings:
-Error 1365 Division by 0
-DROP PROCEDURE sp4;
-set @@sql_mode='';
-
-Section 3.1.8 - SHOW statement checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.8.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-DROP PROCEDURE IF EXISTS sp6a;
-DROP PROCEDURE IF EXISTS sp6b;
-DROP PROCEDURE IF EXISTS sp6c;
-CREATE PROCEDURE sp6a (i1 longtext, out i2 mediumint , inout i3 longblob, in i4 year, out i5 real)
-language sql
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-CREATE PROCEDURE sp6b (out i1 longtext, out i2 mediumint , out i3 longblob, out i4 year, out i5 real)
-deterministic
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-CREATE PROCEDURE sp6c (inout i1 longtext, inout i2 mediumint , inout i3 longblob, inout i4 year, inout i5 real) comment 'this is a comment'
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-show CREATE PROCEDURE sp6a;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6a CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6a`(i1 longtext, out i2 mediumint , inout i3 longblob, in i4 year, out i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-show CREATE PROCEDURE sp6b;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6b CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6b`(out i1 longtext, out i2 mediumint , out i3 longblob, out i4 year, out i5 real)
- DETERMINISTIC
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-show CREATE PROCEDURE sp6c;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6c CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6c`(inout i1 longtext, inout i2 mediumint , inout i3 longblob, inout i4 year, inout i5 real)
- COMMENT 'this is a comment'
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6a';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6a PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6b';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6b PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6c';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6c PROCEDURE root@localhost modified created DEFINER this is a comment latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6a;
-DROP PROCEDURE sp6b;
-DROP PROCEDURE sp6c;
-
-Testcase 4.8.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-SHOW CREATE FUNCTION sp6;
-ERROR 42000: FUNCTION sp6 does not exist
-DROP PROCEDURE sp6;
-
-Testcase 4.8.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE FUNCTION sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) returns longtext
-BEGIN
-set @x=i1;
-set @y=@x;
-return 0;
-END//
-show function status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION sp6;
-
-Testcase 4.8.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7;
-show CREATE PROCEDURE sp7;
-ERROR 42000: PROCEDURE sp7 does not exist
-
-Testcase 4.8.6:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-show procedure status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.7:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-show CREATE PROCEDURE fn1;
-ERROR 42000: PROCEDURE fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 4.8.8:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-show procedure status like 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP FUNCTION fn1;
-
-Testcase 4.8.9:
---------------------------------------------------------------------------------
-
-Testcase 4.8.10:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.11:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-show CREATE PROCEDURE fn1;
-ERROR 42000: PROCEDURE fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 4.8.12:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(x int) returns int
-BEGIN
-return x;
-END//
-DROP FUNCTION fn1;
-show CREATE FUNCTION fn1;
-ERROR 42000: FUNCTION fn1 does not exist
-
-Testcase 4.8.13:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS f1000;
-SHOW FUNCTION STATUS LIKE 'f1000';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.14:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-SELECT * from t8;
-END//
-show CREATE FUNCTION sp1;
-ERROR 42000: FUNCTION sp1 does not exist
-DROP PROCEDURE sp1;
-
-Testcase 4.8.15:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-show function status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP PROCEDURE sp6;
-
-Testcase 4.8.16:
---------------------------------------------------------------------------------
-
-Testcase 4.8.17:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-alter procedure sp6 sql security invoker;
-alter procedure sp6 comment 'this is a new comment';
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created INVOKER this is a new comment latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.18:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-alter function fn1 sql security invoker;
-show create function fn1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
- SQL SECURITY INVOKER
-BEGIN
-return x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.19:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 longtext) returns longtext
-BEGIN
-return i1;
-END//
-alter function fn1 sql security invoker;
-alter function fn1 comment 'this is a function 3242#@%$#@';
-show function status like 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is a function 3242#@%$#@ latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.20:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 int , i2 int)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-alter procedure sp6 comment 'this is simple';
-show CREATE PROCEDURE sp6;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6`(i1 int , i2 int)
- COMMENT 'this is simple'
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.21:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 int, i2 int)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-DROP PROCEDURE sp6;
-show CREATE PROCEDURE sp6;
-ERROR 42000: PROCEDURE sp6 does not exist
-
-Testcase 4.8.22:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i3;
-set @y=@x;
-END//
-DROP PROCEDURE sp6;
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.23:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-DROP FUNCTION fn1;
-show CREATE FUNCTION fn1;
-ERROR 42000: FUNCTION fn1 does not exist
-
-Testcase 4.8.24:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 longtext) returns longtext
-BEGIN
-return i1;
-END//
-DROP FUNCTION fn1;
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Section 3.1.9 - Routine body checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.9.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-SELECT * from t9 limit 0, 100;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
--4991 a_aaaaaaaaa -4991
--4992 a^aaaaaaaa -4992
--4993 agaaaaaaa -4993
--4994 afaaaaaa -4994
--4995 aeaaaaa -4995
--4996 adaaaa -4996
--4997 acaaa -4997
--4998 abaa -4998
--4999 aaa -4999
--5000 a` -5000
-DROP PROCEDURE sp6;
-
-Testcase 4.9.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-delete from res_t9;
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-f1 f2 f3
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-update res_t9 set f2 = 1000 where f2 = 50;
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-f1 f2 f3
-30 1000 111
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i1;
-set @y = i3;
-set @z = i5;
-set @a = @x;
-set @b = @y;
-set @c = @z;
-create table res_t9(f1 longtext, f2 longblob, f3 real);
-insert into res_t9 values (@a, @b, @c);
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-10 30 50
-DROP PROCEDURE sp6;
-drop table IF EXISTS res_t9;
-
-Testcase 4.9.6:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-SELECT * from t9 limit 0, 100;
-return i1;
-END//
-ERROR 0A000: Not allowed to return a result set from a function
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-Warnings:
-Note 1051 Unknown table 'res_t9'
-create table res_t9 (f1 int, f2 char(25), f3 int);
-insert into res_t9 values (10, 'abc', 20);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-delete from res_t9;
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-create table res_t9 (f1 longtext, f2 longblob, f3 real);
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-Warnings:
-Note 1051 Unknown table 'res_t9'
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-insert into res_t9 values (100, 'abc', 300);
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-insert into res_t9 values (10, 'abc', 20);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-update res_t9 set f1 = 20;
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-drop table res_t9;
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-
-Testcase 4.9.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 longtext, f2 longblob, f3 real);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i1;
-set @y = i3;
-set @z = i5;
-set @a = @x;
-set @b = @y;
-set @c = @z;
-insert into res_t9 values (@a, @b, @c);
-SELECT * from res_t9;
-create index index_1 on res_t9 (f1 (5));
-show index from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-10 30 50
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-res_t9 1 index_1 1 f1 A NULL 5 NULL YES BTREE
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Section 3.1._ - :
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.11.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1305 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @xx=1;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for 1318 set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for 1305 set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1 ();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.6:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.8:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.9:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @xx=1;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.10:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1 ();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.11:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.12:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.13:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-fetch cur1 into a, b;
-SELECT done;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.14:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-fetch cur1 into a, b;
-SELECT done;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.15:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-set @x=0;
-fetch cur1 into a, b;
-SELECT @x=1;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-@x=1
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.16:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-set @x=0;
-fetch cur1 into a, b;
-SELECT @x=1;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-@x=1
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.17:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate 'HY000' set done = 1;
-open cur1;
-SELECT done;
-fetch cur1 into a;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.18:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1328 set done = 1;
-open cur1;
-SELECT done;
-fetch cur1 into a;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.19:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate 'HY000' set done = 1;
-open cur1;
-SELECT done;
-set @x=0;
-fetch cur1 into a;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.20:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1328 set done = 1;
-open cur1;
-SELECT done;
-set @x=0;
-fetch cur1 into a;
-set @x=1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.21:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1325 set done = 1;
-open cur1;
-SELECT done;
-open cur1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.22:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1325 set done = 1;
-open cur1;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.23:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1325 set done = 1;
-open cur1;
-set @x=0;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.24:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '24000' set done = 1;
-open cur1;
-set @x=0;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.25:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1326 set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.26:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '24000' set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.27:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1326 set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.28:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '24000' set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.29:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1339 set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.30:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '20000' set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.31:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1339 set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.32:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '20000' set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.33:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-CREATE PROCEDURE h1()
-BEGIN
-declare condname condition for sqlstate '20000';
-declare done int default 0;
-declare a, b char;
-declare condname condition for sqlstate '20000';
-declare cur1 cursor for SELECT w, x from t1;
-set @x=2;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-ERROR 42000: Duplicate condition: condname
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.35:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-CREATE TABLE res_t1(w INT UNIQUE, x CHAR);
-insert into res_t1 values (1, 'a');
-CREATE PROCEDURE h1 ()
-begin1_label:BEGIN
-declare condname1 condition for sqlstate '020';
-declare condname2 condition for sqlstate 'wewe';
-declare condname3 condition for 9999;
-declare exit handler for sqlstate '020' set @var1 = 1;
-declare exit handler for sqlstate 'wewe'set @var1 = 1;
-declare exit handler for 9999 set @var1 = 1;
-set @var2 = 1;
-insert into res_t1 values (2, 'b');
-begin2_label: BEGIN
-declare continue handler for sqlstate '90000023' set @var3= 1;
-set @var4 = 1;
-insert into res_t1 values (3, 'c');
-END begin2_label;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '020'
-CREATE PROCEDURE h1 ()
-begin1_label:BEGIN
-declare condname1 condition for sqlstate '020';
-declare condname2 condition for sqlstate 'wewe';
-declare condname3 condition for 9999;
-set @var2 = 1;
-insert into res_t1 values (2, 'b');
-begin2_label: BEGIN
-declare continue handler for sqlstate '90000023' set @var3= 1;
-set @var4 = 1;
-insert into res_t1 values (3, 'c');
-END begin2_label;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '020'
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.36:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for condname1 set @x = 1;
-set x1 = 1;
-set x1 = 2;
-END;
-SELECT @x, x1;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-DROP PROCEDURE IF EXISTS h1;
-
-Testcase 4.11.40:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char unique, x char);
-insert into res_t1 values ('a', 'b');
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5 int default 0;
-declare condname1 condition for sqlstate '42000';
-declare condname2 condition for sqlstate '42000';
-declare continue handler for condname1 set x1 = 1;
-declare continue handler for condname1 set x2 = 1;
-declare exit handler for condname1 set x3 = 1;
-declare continue handler for condname2 set x4 = 1;
-declare exit handler for condname2 set x5 = 1;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.41:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for sqlstate '00000' set @x = 1;
-set x1 = 1;
-set x1 = 2;
-END;
-SELECT @x, x1;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-CALL h1();
-ERROR 42000: PROCEDURE db_storedproc.h1 does not exist
-DROP PROCEDURE IF EXISTS h1;
-
-* Testcase 3.1.2.53 (4.11.42):
-* Ensure that a handler condition of sqlwarning takes the same action as a
-* handler condition defined with an sqlstate that begins with 01.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-CREATE PROCEDURE h1()
-BEGIN
-DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=1;
-insert into res_t1 values('xxx', 'yy');
-set @x=0;
-END//
-CALL h1();
-ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
-SELECT @done, @x;
-@done @x
-0 1
-CREATE TABLE res_t1(w CHAR, x CHAR);
-INSERT INTO res_t1 VALUES('a', 'b');
-INSERT INTO res_t1 VALUES('c', 'd');
-CALL h1();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-CREATE PROCEDURE h1()
-BEGIN
-DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=0;
-insert into res_t1 values('xxx', 'yy');
-set @x=1;
-END//
-CALL h1();
-ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
-SELECT @done, @x;
-@done @x
-0 0
-CREATE TABLE res_t1(w CHAR, x CHAR);
-INSERT INTO res_t1 VALUES('a', 'b');
-INSERT INTO res_t1 VALUES('c', 'd');
-CALL h1();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc.result b/mysql-test/suite/funcs_1/r/myisam_storedproc.result
deleted file mode 100644
index 47e8ab24a01..00000000000
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc.result
+++ /dev/null
@@ -1,23608 +0,0 @@
-SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
-
-Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
-FUNCTION, ALTER PROCEDURE, ALTER FUNCTION, DROP PROCEDURE, DROP FUNCTION, SHOW
-CREATE PROCEDURE, SHOW CREATE FUNCTION, SHOW CREATE PROCEDURE STATUS, SHOW
-CREATE FUNCTION STATUS, and CALL statements:
---------------------------------------------------------------------------------
-
-Testcase 4.1.1:
----------------
-Ensure that all clauses that should be supported are supported
-CREATE PROCEDURE
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934 (f1 char(20) )
-SELECT * from t1 where f2 = f1;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934('aaaa');
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 tinytext ) language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1, @v1;
-END//
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 binary ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-3
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 blob ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-34
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 int ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-34
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 decimal(256, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-ERROR 42000: Too big precision 256 specified for column ''. Maximum is 65.
-DROP PROCEDURE IF EXISTS sp1//
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(66, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-ERROR 42000: Too big precision 66 specified for column ''. Maximum is 65.
-DROP PROCEDURE IF EXISTS sp1//
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(60, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 17976931340000 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.797693134e+13 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.7976931348623157493578e+308 );
-ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing
-CALL sp1( 0.1234567890987654321e+100 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-100 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+99 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-99 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+98 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-98 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+97 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-97 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+96 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-96 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+95 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-95 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+94 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-94 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+93 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-93 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+92 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-92 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+91 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-91 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+90 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-90 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+89 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-89 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+88 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-88 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+87 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-87 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+86 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-86 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+85 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-85 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+84 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-84 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+83 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-83 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+82 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-82 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+81 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-81 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+80 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-80 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+79 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-79 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+78 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-78 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+77 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-77 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+76 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-76 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+75 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-75 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+74 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-74 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+73 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-73 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+72 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-72 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+71 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-71 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+70 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-70 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+69 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-69 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+68 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-68 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+67 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-67 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+66 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-66 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+65 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-65 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+64 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-64 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+63 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-63 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+62 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-62 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+61 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-61 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+60 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-60 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+59 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-59 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+58 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-58 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+57 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-57 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+56 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-56 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+55 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-55 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+54 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-54 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+53 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-53 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+52 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-52 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+51 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-51 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+50 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-50 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+49 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-49 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+48 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-48 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+47 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-47 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+46 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-46 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+45 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-45 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+44 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-44 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+43 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-43 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+42 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-42 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+41 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-41 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+40 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-40 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+39 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-39 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+38 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-38 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+37 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-37 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+36 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-36 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+35 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-35 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+34 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-34 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+33 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-33 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+32 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-32 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+31 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-31 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+30 );
-@v1
-123456789098765400000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-30 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+29 );
-@v1
-12345678909876540000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-29 );
-@v1
-0.000000000000000000000000000001
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+28 );
-@v1
-1234567890987654000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-28 );
-@v1
-0.000000000000000000000000000012
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+27 );
-@v1
-123456789098765400000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-27 );
-@v1
-0.000000000000000000000000000123
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+26 );
-@v1
-12345678909876540000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-26 );
-@v1
-0.000000000000000000000000001235
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+25 );
-@v1
-1234567890987654000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-25 );
-@v1
-0.000000000000000000000000012346
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+24 );
-@v1
-123456789098765400000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-24 );
-@v1
-0.000000000000000000000000123457
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+23 );
-@v1
-12345678909876540000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-23 );
-@v1
-0.000000000000000000000001234568
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+22 );
-@v1
-1234567890987654000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-22 );
-@v1
-0.000000000000000000000012345679
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+21 );
-@v1
-123456789098765400000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-21 );
-@v1
-0.000000000000000000000123456789
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+20 );
-@v1
-12345678909876540000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-20 );
-@v1
-0.000000000000000000001234567891
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+19 );
-@v1
-1234567890987654000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-19 );
-@v1
-0.000000000000000000012345678910
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+18 );
-@v1
-123456789098765400.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-18 );
-@v1
-0.000000000000000000123456789099
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+17 );
-@v1
-12345678909876540.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-17 );
-@v1
-0.000000000000000001234567890988
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+16 );
-@v1
-1234567890987654.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-16 );
-@v1
-0.000000000000000012345678909877
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+15 );
-@v1
-123456789098765.400000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-15 );
-@v1
-0.000000000000000123456789098765
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+14 );
-@v1
-12345678909876.540000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-14 );
-@v1
-0.000000000000001234567890987654
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+13 );
-@v1
-1234567890987.654000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-13 );
-@v1
-0.000000000000012345678909876540
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+12 );
-@v1
-123456789098.765400000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-12 );
-@v1
-0.000000000000123456789098765400
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+11 );
-@v1
-12345678909.876540000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-11 );
-@v1
-0.000000000001234567890987654000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+10 );
-@v1
-1234567890.987654000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-10 );
-@v1
-0.000000000012345678909876540000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+9 );
-@v1
-123456789.098765400000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-9 );
-@v1
-0.000000000123456789098765400000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+8 );
-@v1
-12345678.909876540000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-8 );
-@v1
-0.000000001234567890987654000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+7 );
-@v1
-1234567.890987654000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-7 );
-@v1
-0.000000012345678909876540000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+6 );
-@v1
-123456.789098765400000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-6 );
-@v1
-0.000000123456789098765400000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+5 );
-@v1
-12345.678909876540000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-5 );
-@v1
-0.000001234567890987654000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+4 );
-@v1
-1234.567890987654000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-4 );
-@v1
-0.000012345678909876550000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+3 );
-@v1
-123.456789098765400000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-3 );
-@v1
-0.000123456789098765400000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+2 );
-@v1
-12.345678909876540000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-2 );
-@v1
-0.001234567890987654000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+1 );
-@v1
-1.234567890987654000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-1 );
-@v1
-0.012345678909876540000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+0 );
-@v1
-0.123456789098765400000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-0 );
-@v1
-0.123456789098765400000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-CALL sp1( "value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 set("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-CALL sp1( "value1, value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-CALL sp1( "value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) language sql SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) deterministic SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) not deterministic SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security definer SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security invoker SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) comment 'this is simple' SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-DROP PROCEDURE sp1;
-
-Testcase 4.1.2:
----------------
-Ensure that all clauses that should be supported are supported
-CREATE FUNCTION
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
-SELECT fn1('world');
-fn1('world')
-hello, world!
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 mediumtext ) returns mediumtext language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = 'hello';
-set f1 = concat( @v1, f1 );
-return f1;
-END//
-SELECT fn1( ' world');
-fn1( ' world')
-hello world
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 decimal(63, 31) ) returns decimal(63, 31) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1000000 + f1;
-return f1;
-END//
-ERROR 42000: Too big scale 31 specified for column ''. Maximum is 30.
-SELECT fn1( 1.3326e+8 );
-ERROR 42000: FUNCTION db_storedproc.fn1 does not exist
-CREATE FUNCTION fn1( f1 decimal(63, 30) ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1000000 + f1;
-return f1;
-END//
-SELECT fn1( 1.3326e+8 );
-fn1( 1.3326e+8 )
-134260000.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 enum("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SELECT fn1( "value1" );
-fn1( "value1" )
-1.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 set("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-SELECT fn1( "value1, value1" );
-fn1( "value1, value1" )
-1.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint deterministic
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint not deterministic
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security definer
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security invoker
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-comment 'this is simple'
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.1.3:
----------------
-Ensure that all clauses that should be supported are supported
-SHOW CREATE PROC
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (f1 char(20) )
-SELECT * from t1 where f2 = f1;
-show CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(f1 char(20) )
-SELECT * from t1 where f2 = f1 latin1 modified created
-DROP PROCEDURE sp1;
-
-Testcase 4.1.4:
----------------
-show create function
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
-show CREATE FUNCTION fn1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(s char(20)) RETURNS char(50) CHARSET latin1
-return concat('hello, ', s, '!') latin1 modified created
-DROP FUNCTION fn1;
-
-Testcase 4.1.5:
----------------
-SHOW PROCEDURE status
---------------------------------------------------------------------------------
-CREATE PROCEDURE sp5()
-SELECT * from t1;
-SHOW PROCEDURE status like 'sp5';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp5 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp5;
-
-Testcase 4.1.6:
----------------
-show function status
---------------------------------------------------------------------------------
-CREATE FUNCTION fn5(a int) returns int
-BEGIN
-set @b = 0.9 * a;
-return @b;
-END//
-SHOW FUNCTION STATUS LIKE 'fn5';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn5 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn5;
-
-Testcase 4.1.7:
----------------
-CALL procedure
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7a;
-DROP PROCEDURE IF EXISTS sp7b;
-DROP PROCEDURE IF EXISTS sp7c;
-CREATE PROCEDURE sp7a(a char(20))
-SELECT * from t1 where t1.f2 = a;
-CALL sp7a( 'xyz' );
-f1 f2 f3 f4 f5 f6
-CREATE PROCEDURE sp7b (a char (20), out b char(20))
-SELECT f1 into b from t1 where t1.f2= a;
-CALL sp7b('xyz', @out_param);
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
-SELECT @out_param;
-@out_param
-NULL
-CREATE PROCEDURE sp7c (a char (20), out b char(20), inout c int)
-BEGIN
-SELECT f1 into b from t1 where t1.f2=a;
-update t1 set t1.f2=999 where t1.f4=c;
-SELECT f2 into c from t1 where t1.f2=999;
-END//
-set @c=1;
-CALL sp7c('xyz', @out_param, @c);
-SELECT @out_param;
-@out_param
-NULL
-SELECT @c;
-@c
-1
-DROP PROCEDURE sp7a;
-DROP PROCEDURE sp7b;
-DROP PROCEDURE sp7c;
-
-Testcase 4.1.8:
----------------
-calling function
---------------------------------------------------------------------------------
-CREATE FUNCTION fn8(a char(20)) returns char(50)
-return concat('hello, ', a, '!');
-SELECT fn8('world');
-fn8('world')
-hello, world!
-DROP FUNCTION fn8;
-
-Testcase 4.1.9:
----------------
-drop procedure
---------------------------------------------------------------------------------
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-DROP PROCEDURE IF EXISTS sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE PROCEDURE sp9()SELECT * from t1;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
-DROP PROCEDURE sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE PROCEDURE sp9()SELECT * from t1;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
-DROP PROCEDURE IF EXISTS sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.1.10:
-----------------
-DROP FUNCTION
---------------------------------------------------------------------------------
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-DROP FUNCTION IF EXISTS fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE FUNCTION fn10() returns int return 100;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci return 100
-DROP FUNCTION fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE FUNCTION fn10() returns int return 100;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci return 100
-DROP FUNCTION IF EXISTS fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.1.11:
-----------------
-alter proc
---------------------------------------------------------------------------------
-create user 'user_1'@'localhost';
-grant execute on db_storedproc.* to 'user_1'@'localhost';
-flush privileges;
-drop table IF EXISTS mysql.t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table mysql.t1( f1 char );
-DROP PROCEDURE IF EXISTS sp11;
-Warnings:
-Note 1305 PROCEDURE sp11 does not exist
-CREATE PROCEDURE sp11() insert into mysql.t1 values('a');
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-DEFINER
-connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
-
-user_1@localhost db_storedproc
-CALL sp11();
-USE db_storedproc;
-
-root@localhost db_storedproc
-alter procedure sp11 sql security invoker;
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-INVOKER
-
-user_1@localhost db_storedproc
-USE db_storedproc;
-CALL sp11();
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't1'
-commit work;
-
-root@localhost db_storedproc
-alter procedure sp11 sql security definer;
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-DEFINER
-CALL sp11();
-DROP USER 'user_1'@'localhost';
-DROP PROCEDURE sp11;
-drop table mysql.t1;
-
-Testcase 4.1.12:
-----------------
-alter function
---------------------------------------------------------------------------------
-CREATE FUNCTION fn12() returns int
-return 100;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-DEFINER
-SELECT fn12();
-fn12()
-100
-alter function fn12 sql security invoker;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-INVOKER
-SELECT fn12();
-fn12()
-100
-alter function fn12 sql security definer;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-DEFINER
-SELECT fn12();
-fn12()
-100
-DROP FUNCTION fn12;
-
-Testcase 4.1.13:
-----------------
-alter proc
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp11;
-Warnings:
-Note 1305 PROCEDURE sp11 does not exist
-CREATE PROCEDURE sp11()
-SELECT * from t1;
-SELECT comment from mysql.proc where specific_name='sp11';
-comment
-
-alter procedure sp11 comment 'this is simple';
-SELECT comment from mysql.proc where specific_name='sp11';
-comment
-this is simple
-DROP PROCEDURE sp11;
-
-Testcase 4.1.14:
-----------------
-alter function
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn12;
-Warnings:
-Note 1305 FUNCTION fn12 does not exist
-CREATE FUNCTION fn12() returns int
-return 100;
-SELECT comment from mysql.proc where specific_name='fn12';
-comment
-
-alter function fn12 comment 'this is simple';
-SELECT comment from mysql.proc where specific_name='fn12';
-comment
-this is simple
-DROP FUNCTION fn12;
-
-Testcase 4.1.15:
-----------------
-Ensure that any invalid stored procedure name is never accepted, and that an
-appropriate error message is returned when the name is rejected
---------------------------------------------------------------------------------
-CREATE PROCEDURE sp1()
-DROP PROCEDURE sp1;
-ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
-CREATE PROCEDURE !_sp1( f1 char(20) )
-SELECT * from t1 where f2 = f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_sp1( f1 char(20) )
-SELECT * from t1 where f2 = f1' at line 1
-CREATE PROCEDURE function()
-SELECT * from t1 where f2=f1;
-DROP PROCEDURE function;
-CREATE PROCEDURE accessible()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE add()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE all()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE alter()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE analyze()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE and()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE as()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE asc()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE asensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE before()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE between()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE bigint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE binary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE blob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE both()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE by()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE call()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cascade()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE case()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE change()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE char()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE character()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE check()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE collate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE column()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE condition()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE constraint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE continue()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE convert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE create()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cross()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_date()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_time()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_timestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_user()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cursor()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE database()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE databases()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_hour()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_minute()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE dec()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE decimal()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE declare()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE default()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE delayed()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE delete()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE desc()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE describe()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE deterministic()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE distinct()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE distinctrow()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE div()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE double()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE drop()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE dual()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE each()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE else()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE elseif()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE enclosed()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE escaped()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE exists()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE exit()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE explain()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE false()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fetch()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fields()
-SELECT * from t1 where f2=f1;
-DROP PROCEDURE fields;
-CREATE PROCEDURE float()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE for()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE force()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE foreign()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE from()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fulltext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE grant()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE group()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE having()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE high_priority()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_minute()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE if()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE ignore()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE in()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE index()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE infile()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE inner()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE inout()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE insensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE insert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int1()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int2()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int3()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int4()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int8()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE integer()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE interval()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE into()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE is()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE iterate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE join()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE key()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE keys()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE kill()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE leading()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE leave()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE left()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE like()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE limit()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE linear()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE lines()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE load()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE localtime()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE localtimestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE lock()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE long()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE longblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE longtext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE loop()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE low_priority()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE master_ssl_verify_server_cert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE match()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumtext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE middleint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE minute_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE minute_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mod()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE modifies()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE natural()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE not()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE no_write_to_binlog()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE null()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE numeric()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE on()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE optimize()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE option()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE optionally()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE or()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE order()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE out()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE outer()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE outfile()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE precision()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE primary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE procedure()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE purge()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE range()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE read()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE reads()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE real()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE references()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE regexp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE release()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE rename()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE repeat()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE replace()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE require()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE restrict()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE return()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE revoke()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE right()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE rlike()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE schema()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE schemas()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE second_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE select()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE separator()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE set()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE show()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE smallint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE spatial()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE specific()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlexception()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlstate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlwarning()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_big_result()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_calc_found_rows()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_small_result()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE ssl()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE starting()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE straight_join()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE table()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE terminated()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE then()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinyblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinyint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinytext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE to()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE trailing()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE trigger()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE true()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE undo()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE union()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unique()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unlock()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unsigned()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE update()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE usage()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE use()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE using()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_date()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_time()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_timestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE values()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varbinary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varchar()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varcharacter()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varying()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE when()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE where()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE while()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE with()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE write()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE xor()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE year_month()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE zerofill()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill()
-SELECT * from t1 where f2=f1' at line 1
-
-Testcase 4.1.15:
-----------------
-Ensure that any invalid function name is never accepted, and that an appropriate
-error message is returned when the name is rejected
---------------------------------------------------------------------------------
-CREATE FUNCTION !_fn1(f1 char) returns char
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_fn1(f1 char) returns char
-return f1' at line 1
-CREATE FUNCTION char(f1 char) returns char
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char(f1 char) returns char
-return f1' at line 1
-CREATE FUNCTION char binary(f1 char binary) returns char binary
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary(f1 char binary) returns char binary
-return f1' at line 1
-CREATE FUNCTION char ascii(f1 char ascii) returns char ascii
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii(f1 char ascii) returns char ascii
-return f1' at line 1
-CREATE FUNCTION char not null(f1 char not null) returns char not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char not null(f1 char not null) returns char not null
-return f1' at line 1
-CREATE FUNCTION char binary not null(f1 char binary not null) returns char binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary not null(f1 char binary not null) returns char binary not null
-retur' at line 1
-CREATE FUNCTION char ascii not null(f1 char ascii not null) returns char ascii not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii not null(f1 char ascii not null) returns char ascii not null
-return f' at line 1
-CREATE FUNCTION tinytext(f1 tinytext) returns tinytext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext(f1 tinytext) returns tinytext
-return f1' at line 1
-CREATE FUNCTION text(f1 text) returns text
-return f1;
-DROP FUNCTION text;
-CREATE FUNCTION mediumtext(f1 mediumtext) returns mediumtext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext(f1 mediumtext) returns mediumtext
-return f1' at line 1
-CREATE FUNCTION longtext(f1 longtext) returns longtext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext(f1 longtext) returns longtext
-return f1' at line 1
-CREATE FUNCTION tinytext not null(f1 tinytext not null) returns tinytext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext not null(f1 tinytext not null) returns tinytext not null
-return f1' at line 1
-CREATE FUNCTION text not null(f1 text not null) returns text not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null(f1 text not null) returns text not null
-return f1' at line 1
-CREATE FUNCTION mediumtext not null(f1 mediumtext not null) returns mediumtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext not null(f1 mediumtext not null) returns mediumtext not null
-return f' at line 1
-CREATE FUNCTION longtext not null(f1 longtext not null) returns longtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext not null(f1 longtext not null) returns longtext not null
-return f1' at line 1
-CREATE FUNCTION tinyblob(f1 tinyblob) returns tinyblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob(f1 tinyblob) returns tinyblob
-return f1' at line 1
-CREATE FUNCTION blob(f1 blob) returns blob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob(f1 blob) returns blob
-return f1' at line 1
-CREATE FUNCTION mediumblob(f1 mediumblob) returns mediumblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob(f1 mediumblob) returns mediumblob
-return f1' at line 1
-CREATE FUNCTION longblob(f1 longblob) returns longblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob(f1 longblob) returns longblob
-return f1' at line 1
-CREATE FUNCTION tinyblob not null(f1 tinyblob not null) returns tinyblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob not null(f1 tinyblob not null) returns tinyblob not null
-return f1' at line 1
-CREATE FUNCTION blob not null(f1 blob not null) returns blob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob not null(f1 blob not null) returns blob not null
-return f1' at line 1
-CREATE FUNCTION mediumblob not null(f1 mediumblob not null) returns mediumblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob not null(f1 mediumblob not null) returns mediumblob not null
-return f' at line 1
-CREATE FUNCTION longblob not null(f1 longblob not null) returns longblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob not null(f1 longblob not null) returns longblob not null
-return f1' at line 1
-CREATE FUNCTION binary(f1 binary) returns binary
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary(f1 binary) returns binary
-return f1' at line 1
-CREATE FUNCTION binary not null(f1 binary not null) returns binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary not null(f1 binary not null) returns binary not null
-return f1' at line 1
-CREATE FUNCTION tinyint(f1 tinyint) returns tinyint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint(f1 tinyint) returns tinyint
-return f1' at line 1
-CREATE FUNCTION tinyint unsigned(f1 tinyint unsigned) returns tinyint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned(f1 tinyint unsigned) returns tinyint unsigned
-return f1' at line 1
-CREATE FUNCTION tinyint zerofill(f1 tinyint zerofill) returns tinyint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint zerofill(f1 tinyint zerofill) returns tinyint zerofill
-return f1' at line 1
-CREATE FUNCTION tinyint unsigned zerofill(f1 tinyint unsigned zerofill) returns tinyint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned zerofill(f1 tinyint unsigned zerofill) returns tinyint unsigned' at line 1
-CREATE FUNCTION smallint(f1 smallint) returns smallint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint(f1 smallint) returns smallint
-return f1' at line 1
-CREATE FUNCTION smallint unsigned(f1 smallint unsigned) returns smallint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned(f1 smallint unsigned) returns smallint unsigned
-return f1' at line 1
-CREATE FUNCTION smallint zerofill(f1 smallint zerofill) returns smallint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint zerofill(f1 smallint zerofill) returns smallint zerofill
-return f1' at line 1
-CREATE FUNCTION smallint unsigned zerofill(f1 smallint unsigned zerofill) returns smallint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned zerofill(f1 smallint unsigned zerofill) returns smallint unsig' at line 1
-CREATE FUNCTION mediumint(f1 mediumint) returns mediumint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint(f1 mediumint) returns mediumint
-return f1' at line 1
-CREATE FUNCTION mediumint unsigned(f1 mediumint unsigned) returns mediumint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned(f1 mediumint unsigned) returns mediumint unsigned
-return f1' at line 1
-CREATE FUNCTION mediumint zerofill(f1 mediumint zerofill) returns mediumint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint zerofill(f1 mediumint zerofill) returns mediumint zerofill
-return f1' at line 1
-CREATE FUNCTION mediumint unsigned zerofill(f1 mediumint unsigned zerofill) returns mediumint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned zerofill(f1 mediumint unsigned zerofill) returns mediumint un' at line 1
-CREATE FUNCTION int(f1 int) returns int
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int(f1 int) returns int
-return f1' at line 1
-CREATE FUNCTION int1(f1 int1) returns int1
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1(f1 int1) returns int1
-return f1' at line 1
-CREATE FUNCTION int2(f1 int2) returns int2
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2(f1 int2) returns int2
-return f1' at line 1
-CREATE FUNCTION int3(f1 int3) returns int3
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3(f1 int3) returns int3
-return f1' at line 1
-CREATE FUNCTION int4(f1 int4) returns int4
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4(f1 int4) returns int4
-return f1' at line 1
-CREATE FUNCTION int8(f1 int8) returns int8
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8(f1 int8) returns int8
-return f1' at line 1
-CREATE FUNCTION int unsigned(f1 int unsigned) returns int unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned(f1 int unsigned) returns int unsigned
-return f1' at line 1
-CREATE FUNCTION int zerofill(f1 int zerofill) returns int zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int zerofill(f1 int zerofill) returns int zerofill
-return f1' at line 1
-CREATE FUNCTION int unsigned zerofill(f1 int unsigned zerofill) returns int unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned zerofill(f1 int unsigned zerofill) returns int unsigned zerofill
-re' at line 1
-CREATE FUNCTION bigint(f1 bigint) returns bigint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint(f1 bigint) returns bigint
-return f1' at line 1
-CREATE FUNCTION bigint unsigned(f1 bigint unsigned) returns bigint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned(f1 bigint unsigned) returns bigint unsigned
-return f1' at line 1
-CREATE FUNCTION bigint zerofill(f1 bigint zerofill) returns bigint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint zerofill(f1 bigint zerofill) returns bigint zerofill
-return f1' at line 1
-CREATE FUNCTION bigint unsigned zerofill(f1 bigint unsigned zerofill) returns bigint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned zerofill(f1 bigint unsigned zerofill) returns bigint unsigned ze' at line 1
-CREATE FUNCTION decimal(f1 decimal) returns decimal
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal(f1 decimal) returns decimal
-return f1' at line 1
-CREATE FUNCTION decimal unsigned(f1 decimal unsigned) returns decimal unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned(f1 decimal unsigned) returns decimal unsigned
-return f1' at line 1
-CREATE FUNCTION decimal zerofill(f1 decimal zerofill) returns decimal zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal zerofill(f1 decimal zerofill) returns decimal zerofill
-return f1' at line 1
-CREATE FUNCTION decimal unsigned zerofill(f1 decimal unsigned zerofill) returns decimal unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned zerofill(f1 decimal unsigned zerofill) returns decimal unsigned' at line 1
-CREATE FUNCTION numeric(f1 numeric) returns numeric
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric(f1 numeric) returns numeric
-return f1' at line 1
-CREATE FUNCTION numeric unsigned(f1 numeric unsigned) returns numeric unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned(f1 numeric unsigned) returns numeric unsigned
-return f1' at line 1
-CREATE FUNCTION numeric zerofill(f1 numeric zerofill) returns numeric zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric zerofill(f1 numeric zerofill) returns numeric zerofill
-return f1' at line 1
-CREATE FUNCTION numeric unsigned zerofill(f1 numeric unsigned zerofill) returns numeric unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned zerofill(f1 numeric unsigned zerofill) returns numeric unsigned' at line 1
-CREATE FUNCTION real(f1 real) returns real
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real(f1 real) returns real
-return f1' at line 1
-CREATE FUNCTION real unsigned(f1 real unsigned) returns real unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned(f1 real unsigned) returns real unsigned
-return f1' at line 1
-CREATE FUNCTION real zerofill(f1 real zerofill) returns real zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real zerofill(f1 real zerofill) returns real zerofill
-return f1' at line 1
-CREATE FUNCTION real unsigned zerofill(f1 real unsigned zerofill) returns real unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned zerofill(f1 real unsigned zerofill) returns real unsigned zerofill' at line 1
-CREATE FUNCTION float(f1 float) returns float
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(f1 float) returns float
-return f1' at line 1
-CREATE FUNCTION float unsigned(f1 float unsigned) returns float unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned(f1 float unsigned) returns float unsigned
-return f1' at line 1
-CREATE FUNCTION float zerofill(f1 float zerofill) returns float zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float zerofill(f1 float zerofill) returns float zerofill
-return f1' at line 1
-CREATE FUNCTION float unsigned zerofill(f1 float unsigned zerofill) returns float unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned zerofill(f1 float unsigned zerofill) returns float unsigned zerof' at line 1
-CREATE FUNCTION date(f1 date) returns date
-return f1;
-DROP FUNCTION date;
-CREATE FUNCTION time(f1 time) returns time
-return f1;
-DROP FUNCTION time;
-CREATE FUNCTION datetime(f1 datetime) returns datetime
-return f1;
-DROP FUNCTION datetime;
-CREATE FUNCTION timestamp(f1 timestamp) returns timestamp
-return f1;
-DROP FUNCTION timestamp;
-CREATE FUNCTION year(f1 year) returns year
-return f1;
-DROP FUNCTION year;
-CREATE FUNCTION year(3)(f1 year(3)) returns year(3)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3)(f1 year(3)) returns year(3)
-return f1' at line 1
-CREATE FUNCTION year(4)(f1 year(4)) returns year(4)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4)(f1 year(4)) returns year(4)
-return f1' at line 1
-CREATE FUNCTION enum("1enum", "2enum")(f1 enum("1enum", "2enum")) returns enum("1enum", "2enum")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"1enum", "2enum")(f1 enum("1enum", "2enum")) returns enum("1enum", "2enum")
-retu' at line 1
-CREATE FUNCTION set("1set", "2set")(f1 set("1set", "2set")) returns set("1set", "2set")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set("1set", "2set")(f1 set("1set", "2set")) returns set("1set", "2set")
-return f' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ) returns char
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 char binary ) returns char binary
-return f1;
-ERROR 42000: This version of MySQL doesn't yet support 'return value collation'
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ascii ) returns char ascii
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 char not null ) returns char not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char binary not null ) returns char binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char binary not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ascii not null ) returns char ascii not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char ascii not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinytext ) returns tinytext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 text ) returns text
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumtext ) returns mediumtext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 longtext ) returns longtext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinytext not null ) returns tinytext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns tinytext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 text not null ) returns text not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns text not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 mediumtext not null ) returns mediumtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns mediumtext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 longtext not null ) returns longtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns longtext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinyblob ) returns tinyblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 blob ) returns blob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumblob ) returns mediumblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 longblob ) returns longblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyblob not null ) returns tinyblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns tinyblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 blob not null ) returns blob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns blob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 mediumblob not null ) returns mediumblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns mediumblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 longblob not null ) returns longblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns longblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 binary ) returns binary
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 binary not null ) returns binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns binary not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinyint ) returns tinyint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint unsigned ) returns tinyint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint zerofill ) returns tinyint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint unsigned zerofill ) returns tinyint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint ) returns smallint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint unsigned ) returns smallint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint zerofill ) returns smallint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint unsigned zerofill ) returns smallint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint ) returns mediumint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint unsigned ) returns mediumint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint zerofill ) returns mediumint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint unsigned zerofill ) returns mediumint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int ) returns int
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int unsigned ) returns int unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int1 unsigned ) returns int1 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int2 unsigned ) returns int2 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int3 unsigned ) returns int3 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int4 unsigned ) returns int4 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int8 unsigned ) returns int8 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int zerofill ) returns int zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int unsigned zerofill ) returns int unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint ) returns bigint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint unsigned ) returns bigint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint zerofill ) returns bigint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint unsigned zerofill ) returns bigint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal ) returns decimal
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal unsigned ) returns decimal unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal zerofill ) returns decimal zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal unsigned zerofill ) returns decimal unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric ) returns numeric
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric unsigned ) returns numeric unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric zerofill ) returns numeric zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric unsigned zerofill ) returns numeric unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real ) returns real
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real unsigned ) returns real unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real zerofill ) returns real zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real unsigned zerofill ) returns real unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float ) returns float
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float unsigned ) returns float unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float zerofill ) returns float zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float unsigned zerofill ) returns float unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 date ) returns date
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 time ) returns time
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 datetime ) returns datetime
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 timestamp ) returns timestamp
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 year ) returns year
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 year(f1 3) ) returns year(3)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 3) ) returns year(3)
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 year(f1 4) ) returns year(4)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 4) ) returns year(4)
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 enum(f1 "1enum", "2enum") ) returns enum("1enum", "2enum")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 "1enum", "2enum") ) returns enum("1enum", "2enum")
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 set(f1 "1set", "2set") ) returns set("1set", "2set")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 "1set", "2set") ) returns set("1set", "2set")
-return f1' at line 1
-
-Testcase 4.1.16:
-----------------
-Ensure that a reference to a non-existent stored procedure is rejected with an
-appropriate error message
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp16;
-Warnings:
-Note 1305 PROCEDURE sp16 does not exist
-CALL sp16( 'xyz' );
-ERROR 42000: PROCEDURE db_storedproc.sp16 does not exist
-CREATE DATABASE db1;
-USE db1;
-CREATE PROCEDURE sp16()
-BEGIN
-set @var1 = 1;
-SELECT @var1;
-END//
-CALL db_storedproc.sp16();
-ERROR 42000: PROCEDURE db_storedproc.sp16 does not exist
-USE db_storedproc;
-DROP PROCEDURE db1.sp16;
-DROP DATABASE db1;
-
-Testcase 4.1.17:
-----------------
-Ensure that it is possible to drop, create and CALL/execute a procedure and a
-function with the same name, even in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 ()
-BEGIN
-declare x enum( 'db1', 'test' ) default 'test';
-SELECT x;
-END//
-CALL sp1();
-x
-test
-CREATE FUNCTION sp1 (y char) returns char return y;
-SELECT sp1( 'a' );
-sp1( 'a' )
-a
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-USE db1;
-CALL db_storedproc.sp1( );
-x
-test
-SELECT db_storedproc.sp1( 'a' );
-db_storedproc.sp1( 'a' )
-a
-DROP FUNCTION db_storedproc.sp1;
-USE db_storedproc;
-SELECT sp1('a');
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-DROP PROCEDURE sp1;
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-SELECT sp1('a');
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-USE db_storedproc;
-DROP DATABASE db1;
-
-Testcase 4.1.18:
-----------------
-Ensure that it is possible to alter a procedure and
-a function with the same name, in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-set @x=null;
-set @y=null;
-CREATE PROCEDURE sp1()
-BEGIN
-set @x= 1;
-SELECT @x;
-END//
-CREATE FUNCTION sp1 () returns int return 2.2;
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-USE db1;
-alter procedure db_storedproc.sp1 sql security invoker;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION DEFINER
-sp1 PROCEDURE INVOKER
-alter function db_storedproc.sp1 sql security invoker;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION INVOKER
-sp1 PROCEDURE INVOKER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-USE db_storedproc;
-alter procedure sp1 sql security definer;
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-alter function sp1 sql security definer;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION DEFINER
-sp1 PROCEDURE DEFINER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-USE db_storedproc;
-DROP DATABASE db1;
-DROP PROCEDURE db_storedproc.sp1;
-DROP FUNCTION db_storedproc.sp1;
-
-Testcase 4.1.19:
-----------------
-verify altering procedure and function with the same name, does not affect
-properties of a procedure and a function with the same name in the different
-database.
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc_3122;
-CREATE DATABASE db_storedproc_3122;
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-DROP PROCEDURE IF EXISTS db_storedproc_3122.sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS db_storedproc_3122.sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-set @x= 1;
-SELECT @x;
-END//
-CREATE FUNCTION db_storedproc_3122.sp1() returns double return 2.2;
-CALL sp1();
-@x
-1
-SELECT db_storedproc_3122.sp1();
-db_storedproc_3122.sp1()
-2.2
-USE db_storedproc_3122;
-CREATE PROCEDURE sp1 ()
-BEGIN
-set @x= 3;
-SELECT @x;
-END//
-CREATE FUNCTION db_storedproc.sp1() returns double return 4.4;
-CALL sp1();
-@x
-3
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-4.4
-alter procedure db_storedproc_3122.sp1 sql security invoker;
-alter function sp1 sql security invoker;
-SELECT db, name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-db name type security_type
-db_storedproc sp1 FUNCTION DEFINER
-db_storedproc sp1 PROCEDURE DEFINER
-db_storedproc_3122 sp1 FUNCTION INVOKER
-db_storedproc_3122 sp1 PROCEDURE INVOKER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-4.4
-CALL db_storedproc_3122.sp1();
-@x
-3
-SELECT db_storedproc_3122.sp1();
-db_storedproc_3122.sp1()
-2.2
-USE db_storedproc;
-DROP DATABASE db_storedproc_3122;
-DROP FUNCTION db_storedproc.sp1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.20:
-----------------
-Ensure that it is possible to alter the comment of a procedure
-and a function with the same name, even in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-DROP PROCEDURE IF EXISTS sp1;
-DROP FUNCTION IF EXISTS sp1;
-CREATE PROCEDURE sp1 () set @x= 1;
-CREATE FUNCTION sp1 () returns int return 2;
-DROP DATABASE IF EXISTS db_storedproc_3122;
-Warnings:
-Note 1008 Can't drop database 'db_storedproc_3122'; database doesn't exist
-CREATE DATABASE db_storedproc_3122;
-USE db_storedproc_3122;
-CREATE PROCEDURE sp1 () set @x= 3;
-CREATE FUNCTION sp1 () returns int return 4;
-alter procedure sp1 sql security invoker comment 'this is a procedure';
-alter function sp1 sql security invoker comment 'this is a function';
-alter procedure sp1 sql security definer;
-alter function sp1 sql security definer;
-show CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
- COMMENT 'this is a procedure'
-set @x= 3 latin1 modified created
-show CREATE FUNCTION sp1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `sp1`() RETURNS int(11)
- COMMENT 'this is a function'
-return 4 latin1 modified created
-USE db_storedproc;
-DROP DATABASE db_storedproc_3122;
-DROP FUNCTION db_storedproc.sp1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.21:
-----------------
-Ensure that it is not possible to create two procedures with same name
-in same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 () set @x=1;
-CREATE PROCEDURE sp1 () set @x=2;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL sp1();
-SELECT @x;
-@x
-1
-USE db1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=3;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL db_storedproc.sp1();
-SELECT @x;
-@x
-1
-DROP PROCEDURE IF EXISTS db_storedproc.sp1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=2;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL db_storedproc.sp1();
-SELECT @x;
-@x
-1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.22:
-----------------
-Ensure that it is not possible to create two functions with same name in the
-same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1 () returns int return 1;
-CREATE FUNCTION fn1 () returns int return 2;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT fn1();
-fn1()
-1
-USE db1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 3;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT db_storedproc.fn1();
-db_storedproc.fn1()
-1
-DROP FUNCTION IF EXISTS db_storedproc.fn1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 2;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT db_storedproc.fn1();
-db_storedproc.fn1()
-1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP FUNCTION db_storedproc.fn1;
-
-Testcase 4.1.23:
-----------------
-Ensure that it is possible to create two or more procedures with the same name,
-providing each resides in different databases
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 () set @x= 1;
-DROP DATABASE IF EXISTS test3124;
-Warnings:
-Note 1008 Can't drop database 'test3124'; database doesn't exist
-CREATE DATABASE test3124;
-USE test3124;
-CREATE PROCEDURE sp1 () set @y= 2;
-CALL sp1();
-SELECT @x, @y;
-@x @y
-NULL 2
-USE db_storedproc;
-CALL sp1();
-SELECT @x, @y;
-@x @y
-1 2
-USE db_storedproc;
-DROP DATABASE test3124;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.24:
-----------------
-Ensure that it is possible to create two or more functions with the same name,
-providing each resides in different databases.
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP FUNCTION IF EXISTS f1;
-Warnings:
-Note 1305 FUNCTION f1 does not exist
-CREATE FUNCTION f1 () returns int return 1;
-DROP DATABASE IF EXISTS test3125;
-Warnings:
-Note 1008 Can't drop database 'test3125'; database doesn't exist
-CREATE DATABASE test3125;
-USE test3125;
-CREATE FUNCTION f1 () returns int return 2;
-SELECT f1();
-f1()
-2
-USE db_storedproc;
-SELECT f1();
-f1()
-1
-USE db_storedproc;
-DROP DATABASE test3125;
-DROP FUNCTION db_storedproc.f1;
-
-Testcase 4.1.25:
-----------------
-Ensure that any invalid function name is never accepted, and that an appropriate
-error message is returned when the name is rejected. (invalid func name)
---------------------------------------------------------------------------------
-CREATE FUNCTION !_fn1( f1 char(20) ) returns int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_fn1( f1 char(20) ) returns int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;' at line 1
-CREATE FUNCTION fn1( f1 char(20) ) return int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END' at line 1
-CREATE FUNCTION fn1() returns int
-return 'a';
-CREATE FUNCTION procedure() returns int
-return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure() returns int
-return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int lang sql return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int deterministic( return 1);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return 1)' at line 1
-CREATE FUNCTION fn1(a char) returns int non deterministic return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int not deterministic comment 'abc' language sql sql security refiner return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'refiner return 1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-
-Testcase 4.1.1:
----------------
-Ensure that all clauses that should be supported are supported.
-CREATE PROCEDURE
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @count = 0;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1(cnt int(20))
-BEGIN
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-END//
-CALL sp1( 10 );
-SELECT @count;
-@count
-10
-DROP PROCEDURE sp1;
-
-Testcase 4.2.2:
-BEGINend
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-BEGIN
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-END//
-CALL sp1( 10 );
-@count
-10
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-END//
-ERROR 42S22: Unknown column 'cnt' in 'field list'
-CALL sp1( 10 );
-DROP PROCEDURE sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-END
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-BEGIN//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-BEGIN' at line 2
-CALL sp1( 10 );
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-BEGIN
-SELECT count(*) into cnt from t2;
-BEGIN
-BEGIN END;
-BEGIN
-END;
-set @count = cnt;
-SELECT @count;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 10
-
-Testcase 4.2.4:
----------------
-Ensure that every BEGIN statement is coupled with a terminating END statement.
-(BEGIN with no END)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-
-Testcase ....:
---------------
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-accessible:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-add:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-all:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-alter:BEGIN
-SELECT @x;
-END//
-ERROR 0A000: ALTER VIEW is not allowed in stored procedures
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-analyze:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-and:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-as:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-asc:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-asensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-before:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-between:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-bigint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-binary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-blob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-both:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-by:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-call:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cascade:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-case:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-change:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-char:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-character:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-check:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-collate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-column:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-condition:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-constraint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-continue:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-convert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-create:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cross:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_date:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_time:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_timestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_user:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cursor:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-database:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-databases:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_hour:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_minute:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-dec:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-decimal:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-declare:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-default:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-delayed:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-delete:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-desc:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-describe:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-deterministic:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-distinct:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-distinctrow:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-div:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-double:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-drop:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-dual:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-each:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-else:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-elseif:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-enclosed:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-escaped:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-exists:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-exit:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-explain:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-false:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-fetch:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float4:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float8:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-for:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-force:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-foreign:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-from:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-fulltext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-grant:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-group:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-having:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-high_priority:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_minute:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-if:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-ignore:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-in:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-index:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-infile:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-inner:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-inout:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-insensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-insert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int1:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int2:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int3:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int4:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int8:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-integer:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-interval:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-into:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-is:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-iterate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-join:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-key:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-keys:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-kill:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-leading:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-leave:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-left:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-like:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-limit:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-linear:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-lines:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-load:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-localtime:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-localtimestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-lock:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-long:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-longblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-longtext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-loop:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-low_priority:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-master_ssl_verify_server_cert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-match:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumtext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-middleint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-minute_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-minute_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mod:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-modifies:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-natural:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-not:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-no_write_to_binlog:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-null:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-numeric:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-on:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-optimize:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-option:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-optionally:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-or:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-order:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-out:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-outer:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-outfile:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-precision:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-primary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-procedure:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-purge:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-range:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-read:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-reads:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-read_write:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-real:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-references:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-regexp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-release:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-rename:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-repeat:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-replace:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-require:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-restrict:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-return:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-revoke:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-right:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-rlike:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-schema:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-schemas:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-second_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-select:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-separator:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-set:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-show:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-smallint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-spatial:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-specific:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlexception:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlstate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlwarning:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_big_result:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_calc_found_rows:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_small_result:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-ssl:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-starting:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-straight_join:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-table:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-terminated:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-then:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinyblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinyint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinytext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-to:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-trailing:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-trigger:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-true:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-undo:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-union:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unique:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unlock:BEGIN
-SELECT @x;
-END//
-ERROR 0A000: UNLOCK is not allowed in stored procedures
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unsigned:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-update:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-usage:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-use:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-using:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_date:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_time:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_timestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-values:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varbinary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varchar:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varcharacter:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varying:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-when:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-where:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-while:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-with:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-write:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-xor:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-year_month:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-zerofill:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill:BEGIN
-SELECT @x;
-END' at line 2
-
-Testcase 4.2.6:
----------------
-Ensure that the labels for multiple BEGIN an END work properly
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char;
-declare y char;
-set x = '1';
-set y = '2';
-label1: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END label1;
-set @v1 = x;
-set @v2 = y;
-SELECT @v1, @v2;
-END begin_label//
-CALL sp1();
-@v1 @v2
-1 2
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE sp1;
-
-Testcase 4.2.7:
----------------
-Ensure that the labels enclosing each BEGIN/END compound statement must match.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin1_label: BEGIN
-declare x char;
-declare y char;
-SELECT lf1, f1 into x, y from t2 limit 1;
-begin2_label: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin2_changed;
-END begin1_changed//
-ERROR 42000: End-label begin2_changed without match
-
-Testcase 4.2.8:
----------------
-Ensure that it is possible to put a beginning label at the start of a
-BEGIN/END compound statement without also requiring an ending label
-at the END of the same statement.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE sp1;
-
-Testcase 4.2.9:
----------------
-Ensure that it is not possible to put an ending label at the END of
-a BEGIN/END compound statement without also requiring a matching
-beginning label at the start of the same statement
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_label//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'begin_label' at line 6
-
-Testcase 4.2.10:
-----------------
-Ensure that every beginning label must END with a colon(:)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_label//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-E' at line 2
-
-Testcase 4.2.11:
-----------------
-Ensure that every beginning label with the same scope must be unique. (same label names)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_samelabel;
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_samelabel;
-END begin_samelabel//
-ERROR 42000: Redefining label begin_samelabel
-
-Testcase 4.2.12:
-----------------
-Ensure that the variables, cursors, conditions, and handlers declared for
-a stored procedure (with the declare statement) may only be properly defined
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x char default 'a';
-declare y integer default 1;
-declare z float default 1.1;
-declare a enum("value1", "value2") default 'value1';
-declare b decimal(255, 255) default 1.2e+12;
-declare c mediumtext default 'mediumtext';
-declare d datetime default '2005-02-02 12:12:12';
-declare e char default 'b';
-declare cur1 cursor for SELECT f1 from db_storedproc.t2;
-declare continue handler for sqlstate '02000' set @x2 = 1;
-open cur1;
-fetch cur1 into e;
-SELECT x, y, z, a, b, c, d, e;
-close cur1;
-END//
-ERROR 42000: Too big scale 255 specified for column ''. Maximum is 30.
-CALL sp6();
-ERROR 42000: PROCEDURE db_storedproc.sp6 does not exist
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 char default '0';
-SELECT x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567;
-END//
-CALL sp6();
-x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
-0
-DROP PROCEDURE sp6;
-
-Testcase 4.2.13:
-----------------
-Ensure that the variables declared for a stored procedure (with the declare
-statement) may only be defined in the correct order.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x default '0' char;
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default '0' char;
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x char, integer default '0';
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' integer default '0';
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x1, x2 char, integer default '0', 1;
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' integer default '0', 1;
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x, y1 integer default 0;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x, y1 integer default 0;
-declare char y;
-SELECT f1, f2 into x, y from t2 li' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x default 'a' char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default 'a' char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition notable for sqlstate '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition notable for sqlstate '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for notable sqlstate '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for notable sqlstate '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for sqlstate notable '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate notable '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for sqlstate '42s22' notable;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '42s22' notable;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor cur1 for SELECT f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor cur1 for SELECT f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor for cur1 SELECT f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor for cur1 SELECT f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor for SELECT cur1 f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor for SELECT cur1 f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler continue for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler exit for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler undo for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x;
-SELECT f1 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x;
-SELECT f1 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char binary x;
-SELECT f2 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary x;
-SELECT f2 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char ascii x;
-SELECT f3 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii x;
-SELECT f3 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext x;
-SELECT f4 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext x;
-SELECT f4 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x;
-SELECT f5 text into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-SELECT f5 text into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext x;
-SELECT f6 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext x;
-SELECT f6 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext x;
-SELECT f7 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext x;
-SELECT f7 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob x;
-SELECT f8 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob x;
-SELECT f8 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob x;
-SELECT f9 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob x;
-SELECT f9 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob x;
-SELECT f10 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob x;
-SELECT f10 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob x;
-SELECT f11 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob x;
-SELECT f11 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary x;
-SELECT f12 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary x;
-SELECT f12 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint x;
-SELECT f13 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint x;
-SELECT f13 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint unsigned x;
-SELECT f14 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned x;
-SELECT f14 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint zerofill x;
-SELECT f15 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint zerofill x;
-SELECT f15 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint unsigned zerofill x;
-SELECT f16 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned zerofill x;
-SELECT f16 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint x;
-SELECT f17 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint x;
-SELECT f17 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint unsigned x;
-SELECT f18 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned x;
-SELECT f18 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint zerofill x;
-SELECT f19 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint zerofill x;
-SELECT f19 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint unsigned zerofill x;
-SELECT f20 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned zerofill x;
-SELECT f20 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint x;
-SELECT f21 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint x;
-SELECT f21 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint unsigned x;
-SELECT f22 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned x;
-SELECT f22 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint zerofill x;
-SELECT f23 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint zerofill x;
-SELECT f23 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint unsigned zerofill x;
-SELECT f24 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned zerofill x;
-SELECT f24 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int x;
-SELECT f25 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int x;
-SELECT f25 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int unsigned x;
-SELECT f26 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned x;
-SELECT f26 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int zerofill x;
-SELECT f27 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int zerofill x;
-SELECT f27 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int unsigned zerofill x;
-SELECT f28 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned zerofill x;
-SELECT f28 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint x;
-SELECT f29 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint x;
-SELECT f29 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint unsigned x;
-elect f30 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned x;
-elect f30 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint zerofill x;
-SELECT f31 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint zerofill x;
-SELECT f31 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint unsigned zerofill x;
-SELECT f32 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned zerofill x;
-SELECT f32 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal x;
-SELECT f33 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal x;
-SELECT f33 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal unsigned x;
-SELECT f34 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned x;
-SELECT f34 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal zerofill x;
-SELECT f35 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal zerofill x;
-SELECT f35 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal unsigned zerofill not null x;
-SELECT f36 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned zerofill not null x;
-SELECT f36 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) not null x;
-SELECT f37 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) not null x;
-SELECT f37 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) not null x;
-SELECT f38 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) not null x;
-SELECT f38 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) unsigned not null x;
-SELECT f39 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) unsigned not null x;
-SELECT f39 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) unsigned not null x;
-SELECT f40 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) unsigned not null x;
-SELECT f40 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) zerofill not null x;
-SELECT f41 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) zerofill not null x;
-SELECT f41 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) zerofill not null x;
-SELECT f42 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) zerofill not null x;
-SELECT f42 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) unsigned zerofill not null x;
-SELECT f43 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) unsigned zerofill not null x;
-SELECT f43 into x from tb1 limit 9998' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) unsigned zerofill not null x;
-SELECT f44 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) unsigned zerofill not null x;
-SELECT f44 into x from tb1 limit 999' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) not null x;
-SELECT f45 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) not null x;
-SELECT f45 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) not null x;
-SELECT f46 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) not null x;
-SELECT f46 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) unsigned not null x;
-SELECT f47 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) unsigned not null x;
-SELECT f47 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) unsigned not null x;
-SELECT f48 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) unsigned not null x;
-SELECT f48 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) zerofill not null x;
-SELECT f49 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) zerofill not null x;
-SELECT f49 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) zerofill not null x;
-SELECT f50 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) zerofill not null x;
-SELECT f50 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) unsigned zerofill not null x;
-SELECT f51 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) unsigned zerofill not null x;
-SELECT f51 into x from tb1 limit 999' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) unsigned zerofill not null x;
-SELECT f52 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) unsigned zerofill not null x;
-SELECT f52 into x from tb1 limit' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric not null x;
-SELECT f53 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric not null x;
-SELECT f53 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric unsigned not null x;
-SELECT f54 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned not null x;
-SELECT f54 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric zerofill not null x;
-SELECT f55 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric zerofill not null x;
-SELECT f55 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric unsigned zerofill not null x;
-SELECT f56 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned zerofill not null x;
-SELECT f56 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) not null x;
-SELECT f57 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) not null x;
-SELECT f57 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) not nul x;
-SELECT f58 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) not nul x;
-SELECT f58 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) unsigned x;
-SELECT f59 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) unsigned x;
-SELECT f59 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) unsigned x;
-SELECT f60 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) unsigned x;
-SELECT f60 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) zerofill x;
-SELECT f61 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) zerofill x;
-SELECT f61 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) zerofill x;
-SELECT f62 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) zerofill x;
-SELECT f62 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) unsigned zerofill x;
-SELECT f63 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) unsigned zerofill x;
-SELECT f63 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) unsigned zerofill x;
-SELECT f64 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) unsigned zerofill x;
-SELECT f64 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) x;
-SELECT f65 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) x;
-SELECT f65 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) x;
-SELECT f66 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) x;
-SELECT f66 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) unsigned x;
-SELECT f67 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) unsigned x;
-SELECT f67 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) unsigned x;
-SELECT f68 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) unsigned x;
-SELECT f68 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) zerofill x;
-SELECT f69 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) zerofill x;
-SELECT f69 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) zerofill x;
-SELECT f70 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) zerofill x;
-SELECT f70 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) unsigned zerofill x;
-SELECT f71 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) unsigned zerofill x;
-SELECT f71 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) unsigned zerofill x;
-SELECT f72 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) unsigned zerofill x;
-SELECT f72 into x from tb2 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real x;
-SELECT f73 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real x;
-SELECT f73 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real unsigned x;
-SELECT f74 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned x;
-SELECT f74 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real zerofill x;
-SELECT f75 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real zerofill x;
-SELECT f75 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real unsigned zerofill x;
-SELECT f76 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned zerofill x;
-SELECT f76 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double x;
-SELECT f77 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double x;
-SELECT f77 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double unsigned x;
-SELECT f78 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double unsigned x;
-SELECT f78 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double zerofill x;
-SELECT f79 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double zerofill x;
-SELECT f79 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double unsigned zerofill x;
-SELECT f80 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double unsigned zerofill x;
-SELECT f80 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float not null x;
-SELECT f81 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float not null x;
-SELECT f81 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float unsigned not null x;
-SELECT f82 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned not null x;
-SELECT f82 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float zerofill not null x;
-SELECT f83 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float zerofill not null x;
-SELECT f83 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float unsigned zerofill not null x;
-SELECT f84 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned zerofill not null x;
-SELECT f84 into x from tb2 limit 9998, 1;
-E' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) not null x;
-SELECT f85 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) not null x;
-SELECT f85 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) not null x;
-SELECT f86 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) not null x;
-SELECT f86 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) unsigned not null x;
-SELECT f87 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) unsigned not null x;
-SELECT f87 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) unsigned not null x;
-SELECT f88 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) unsigned not null x;
-SELECT f88 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) zerofill not null x;
-SELECT f89 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) zerofill not null x;
-SELECT f89 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) zerofill not null x;
-SELECT f90 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) zerofill not null x;
-SELECT f90 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) unsigned zerofill not null x;
-SELECT f91 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) unsigned zerofill not null x;
-SELECT f91 into x from tb2 limit 9998, 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) unsigned zerofill not null x;
-SELECT f92 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) unsigned zerofill not null x;
-SELECT f92 into x from tb2 limit 9998, ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) not null x;
-SELECT f93 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) not null x;
-SELECT f93 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) not null x;
-SELECT f94 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) not null x;
-SELECT f94 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) unsigned not null x;
-SELECT f95 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) unsigned not null x;
-SELECT f95 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) unsigned not null x;
-SELECT f96 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) unsigned not null x;
-SELECT f96 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) zerofill not null x;
-SELECT f97 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) zerofill not null x;
-SELECT f97 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) zerofill not null x;
-SELECT f98 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) zerofill not null x;
-SELECT f98 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) unsigned zerofill not null x;
-SELECT f99 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) unsigned zerofill not null x;
-SELECT f99 into x from tb2 limit 9998, ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) unsigned zerofill not null x;
-SELECT f100 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) unsigned zerofill not null x;
-SELECT f100 into x from tb2 limit 9998,' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare date not null x;
-SELECT f101 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f101 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare time not null x;
-SELECT f102 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f102 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare datetime not null x;
-SELECT f103 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f103 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare timestamp not null x;
-SELECT f104 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f104 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year not null x;
-SELECT f105 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f105 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year(3) not null x;
-SELECT f106 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(3) not null x;
-SELECT f106 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year(4) not null x;
-SELECT f107 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(4) not null x;
-SELECT f107 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enum("1enum", "2enum") not null x;
-SELECT f108 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '("1enum", "2enum") not null x;
-SELECT f108 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set("1set", "2set") not nul x;
-SELECT f109 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set("1set", "2set") not nul x;
-SELECT f109 into x from tb2 limit 9998, 1;
-END' at line 3
-
-Testcase 4.2.14:
-----------------
-Ensure that the handlers declared for a stored procedure (with the declare
-statement) may only be defined in the correct order
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '23000' set @x2 = 1;
-declare x char;
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor1 cursor for SELECT f1 from tb1;
-declare x char;
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor1 cursor for SELECT f1 from tb1;
-declare sqlcondition condition for sqlstate '02000';
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare sqlcondition condition for sqlstate '02000';
-declare continue handler for sqlcondition set @x=1;
-declare cursor1 cursor for SELECT f1 from tb1;
-END//
-ERROR 42000: Cursor declaration after handler declaration
-
-Testcase 4.2.15:
-----------------
-Ensure that the declare statement can declare multiple variables both separately
-and all at once from a variable list. (multiple declaration)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-DECLARE x1 CHAR(100) DEFAULT 'outer';
-BEGIN
-DECLARE x1 CHAR(100) DEFAULT x1;
-END;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z char default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z char ascii default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinytext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z text default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumtext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z longtext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z blob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z longblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z binary default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint default -126;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--126 -126 -126
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint unsigned default 253;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-253 253 253
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-000 000 000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-001 001 001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint default -32768;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--32768 -32768 -32768
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint unsigned default 65535;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-65535 65535 65535
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000 00000 00000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00001 00001 00001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint default -8388608;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--8388608 -8388608 -8388608
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint unsigned default 16777215;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-16777215 16777215 16777215
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000 00000000 00000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001 00000001 00000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int default -2147483648;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--2147483648 -2147483648 -2147483648
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int unsigned default 4294967295;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-4294967295 4294967295 4294967295
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000001 0000000001 0000000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint default -9223372036854775808;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--9223372036854775808 -9223372036854775808 -9223372036854775808
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint unsigned default 18446744073709551615;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-18446744073709551615 18446744073709551615 18446744073709551615
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000000000000000 00000000000000000000 00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000000000000001 00000000000000000001 00000000000000000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal default -34028234660123456789012345678901234567;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--9999999999 -9999999999 -9999999999
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal zerofill default -34028234660123456789012345678901234567;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.175494351e-38 1.175494351e-38 1.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.175494351e-38 1.175494351e-38 1.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001.175494351e-38 00000001.175494351e-38 00000001.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001.175494351e-38 00000001.175494351e-38 00000001.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.17549e-38 1.17549e-38 1.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.17549e-38 1.17549e-38 1.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-01.17549e-38 01.17549e-38 01.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-01.17549e-38 01.17549e-38 01.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z date default '2005-02-02';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 2005-02-02 2005-02-02
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z time default '12:20:12';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-12:20:12 12:20:12 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z datetime default '2005-02-02 12:20:12';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 12:20:12 2005-02-02 12:20:12 2005-02-02 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z timestamp default '20050202122012';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 12:20:12 2005-02-02 12:20:12 2005-02-02 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year(3) default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year(4) default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z enum("1enum", "2enum") default "2enum";
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2enum 2enum 2enum
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z set("1set", "2set") default "2set";
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2set 2set 2set
-DROP PROCEDURE sp1;
-
-Testcase 4.2.16:
-----------------
-Ensure that the declare statement can declare multiple variables both separately
-and all at once from a variable list. (multiple declaration).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare a, b char default '2';
-declare c, d float default 1.3;
-declare e, f text default 'text';
-declare g, h enum("value1", "value2" ) default 'value1';
-declare i, j datetime default '2005-02-02 12:12:12';
-declare k, l blob default 'blob';
-SELECT a, b, c, d, e, f, g, h, k, l;
-END//
-CALL sp6();
-a b c d e f g h k l
-2 2 1.3 1.3 text text value1 value1 blob blob
-DROP PROCEDURE sp6;
-
-Testcase 4.2.17:
-----------------
-Ensure that the invalid variable declarations are rejected, with an appropriate
-error message.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare @x char;
-SELECT f2 into x from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@x char;
-SELECT f2 into x from t2 limit 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare accessible char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare add char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare all char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare alter char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare analyze char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare and char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare as char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare asc char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare asensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare before char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare between char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare bigint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare binary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare blob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare both char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare by char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare call char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cascade char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare case char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare change char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare char char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare character char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare check char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare collate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare column char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare condition char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare constraint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare convert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare create char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cross char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_date char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_time char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_timestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_user char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cursor char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare database char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare databases char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_hour char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_minute char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare dec char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare decimal char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare declare char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare default char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare delayed char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare delete char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare desc char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare describe char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare deterministic char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare distinct char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare distinctrow char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare div char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare double char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare drop char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare dual char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare each char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare else char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare elseif char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare enclosed char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare escaped char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare exists char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare exit char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare explain char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare false char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare fetch char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float4 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float8 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare for char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare force char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare foreign char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare from char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare fulltext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare grant char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare group char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare having char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare high_priority char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_minute char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare if char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare ignore char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare in char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare index char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare infile char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare inner char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare inout char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare insensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare insert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int1 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int2 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int3 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int4 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int8 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare integer char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare interval char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare into char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare is char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare iterate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare join char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare key char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare keys char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare kill char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare leading char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare leave char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare left char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare like char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare limit char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare linear char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare lines char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare load char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare localtime char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare localtimestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare lock char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare long char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare longblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare longtext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare loop char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare low_priority char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare master_ssl_verify_server_cert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare match char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumtext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare middleint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare minute_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare minute_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mod char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare modifies char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare natural char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare not char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare no_write_to_binlog char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare null char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare numeric char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare on char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare optimize char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare option char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare optionally char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare or char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare order char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare out char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare outer char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare outfile char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare precision char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare primary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare procedure char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare purge char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare range char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare reads char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read_only char;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read_write char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare real char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare references char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare regexp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare release char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare rename char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare repeat char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare replace char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare require char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare restrict char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare return char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare revoke char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare right char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare rlike char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare schema char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare schemas char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare second_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare SELECT char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare separator char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare set char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare show char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare smallint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare spatial char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare specific char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlexception char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlstate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlwarning char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_big_result char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_calc_found_rows char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_small_result char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare ssl char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare starting char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare straight_join char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare table char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare terminated char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare then char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinyblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinyint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinytext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare to char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare trailing char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare trigger char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare true char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare undo char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare union char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unique char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unlock char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unsigned char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare update char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare usage char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare use char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare using char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_date char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_time char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_timestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare values char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varbinary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varchar char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varcharacter char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varying char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare when char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare where char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare while char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare with char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare write char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xor char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare year_month char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare zerofill char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill char;
-END' at line 3
-
-Testcase :
-----------
-Ensure that every possible type of condition may be declared for a stored procedure
-( covered in more detail in handlers section.)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'HY000';
-declare cond2 condition for sqlstate '23000';
-declare cond3 condition for sqlstate 'HY001';
-declare cond4 condition for sqlstate '08004';
-declare cond5 condition for sqlstate '08S01';
-declare cond6 condition for sqlstate '42000';
-declare cond7 condition for sqlstate '28000';
-declare cond8 condition for sqlstate '3D000';
-declare cond9 condition for sqlstate '42S01';
-declare cond10 condition for sqlstate '42S02';
-declare cond11 condition for sqlstate '42S22';
-declare cond12 condition for sqlstate '21S01';
-declare cond13 condition for sqlstate '42S21';
-declare cond14 condition for sqlstate '42S12';
-declare cond15 condition for sqlstate '22004';
-declare cond16 condition for sqlstate '25000';
-declare cond17 condition for sqlstate '40001';
-declare cond18 condition for sqlstate '21000';
-declare cond19 condition for sqlstate '01000';
-declare cond20 condition for sqlstate '22003';
-declare cond21 condition for sqlstate '22007';
-declare cond22 condition for sqlstate '0A000';
-declare cond23 condition for sqlstate '70100';
-declare cond24 condition for sqlstate '2F005';
-declare cond25 condition for sqlstate '24000';
-declare cond26 condition for sqlstate '02000';
-declare continue handler for cond2 set @x2 = 1;
-declare continue handler for cond1 set @x2 = 1;
-declare continue handler for cond3 set @x2 = 1;
-declare continue handler for cond4 set @x2 = 1;
-declare continue handler for cond5 set @x2 = 1;
-declare continue handler for cond7 set @x2 = 1;
-declare continue handler for cond6 set @x2 = 1;
-declare continue handler for cond8 set @x2 = 1;
-declare continue handler for cond9 set @x2 = 1;
-declare continue handler for cond10 set @x2 = 1;
-declare continue handler for cond11 set @x2 = 1;
-declare continue handler for cond12 set @x2 = 1;
-declare continue handler for cond13 set @x2 = 1;
-declare continue handler for cond14 set @x2 = 1;
-declare continue handler for cond15 set @x2 = 1;
-declare continue handler for cond16 set @x2 = 1;
-declare continue handler for cond17 set @x2 = 1;
-declare continue handler for cond18 set @x2 = 1;
-declare continue handler for cond19 set @x2 = 1;
-declare continue handler for cond20 set @x2 = 1;
-declare continue handler for cond21 set @x2 = 1;
-declare continue handler for cond22 set @x2 = 1;
-declare continue handler for cond23 set @x2 = 1;
-declare continue handler for cond24 set @x2 = 1;
-declare continue handler for cond25 set @x2 = 1;
-declare continue handler for cond26 set @x2 = 1;
-set @x = 1;
-insert into t2 values (1);
-set @x = 2;
-insert into t2 values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare @x char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@x char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare accessible condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible condition for sqlstate '02000';
-declare exit handler for add set @var' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare add condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare all condition for sqlstate '02000';
-declare exit handler for all set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all condition for sqlstate '02000';
-declare exit handler for all set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare alter condition for sqlstate '02000';
-declare exit handler for alter set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter condition for sqlstate '02000';
-declare exit handler for alter set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare analyze condition for sqlstate '02000';
-declare exit handler for analyze set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze condition for sqlstate '02000';
-declare exit handler for analyze set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare and condition for sqlstate '02000';
-declare exit handler for and set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and condition for sqlstate '02000';
-declare exit handler for and set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare as condition for sqlstate '02000';
-declare exit handler for as set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as condition for sqlstate '02000';
-declare exit handler for as set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asc condition for sqlstate '02000';
-declare exit handler for asc set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc condition for sqlstate '02000';
-declare exit handler for asc set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asensitive condition for sqlstate '02000';
-declare exit handler for asensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive condition for sqlstate '02000';
-declare exit handler for asensitive s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare before condition for sqlstate '02000';
-declare exit handler for before set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before condition for sqlstate '02000';
-declare exit handler for before set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare between condition for sqlstate '02000';
-declare exit handler for between set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between condition for sqlstate '02000';
-declare exit handler for between set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint condition for sqlstate '02000';
-declare exit handler for bigint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint condition for sqlstate '02000';
-declare exit handler for bigint set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary condition for sqlstate '02000';
-declare exit handler for binary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary condition for sqlstate '02000';
-declare exit handler for binary set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob condition for sqlstate '02000';
-declare exit handler for blob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob condition for sqlstate '02000';
-declare exit handler for blob set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare both condition for sqlstate '02000';
-declare exit handler for both set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both condition for sqlstate '02000';
-declare exit handler for both set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare by condition for sqlstate '02000';
-declare exit handler for by set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by condition for sqlstate '02000';
-declare exit handler for by set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare call condition for sqlstate '02000';
-declare exit handler for CALL set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call condition for sqlstate '02000';
-declare exit handler for CALL set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cascade condition for sqlstate '02000';
-declare exit handler for cascade set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade condition for sqlstate '02000';
-declare exit handler for cascade set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare case condition for sqlstate '02000';
-declare exit handler for case set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case condition for sqlstate '02000';
-declare exit handler for case set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare change condition for sqlstate '02000';
-declare exit handler for change set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change condition for sqlstate '02000';
-declare exit handler for change set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char condition for sqlstate '02000';
-declare exit handler for char set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char condition for sqlstate '02000';
-declare exit handler for char set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare character condition for sqlstate '02000';
-declare exit handler for character set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character condition for sqlstate '02000';
-declare exit handler for character set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare check condition for sqlstate '02000';
-declare exit handler for check set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check condition for sqlstate '02000';
-declare exit handler for check set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare collate condition for sqlstate '02000';
-declare exit handler for collate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate condition for sqlstate '02000';
-declare exit handler for collate set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare column condition for sqlstate '02000';
-declare exit handler for column set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column condition for sqlstate '02000';
-declare exit handler for column set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare condition condition for sqlstate '02000';
-declare exit handler for condition set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition condition for sqlstate '02000';
-declare exit handler for condition set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare connection condition for sqlstate '02000';
-declare exit handler for connection set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare constraint condition for sqlstate '02000';
-declare exit handler for constraint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint condition for sqlstate '02000';
-declare exit handler for constraint s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare continue condition for sqlstate '02000';
-declare exit handler for continue set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for continue set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare convert condition for sqlstate '02000';
-declare exit handler for convert set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert condition for sqlstate '02000';
-declare exit handler for convert set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare create condition for sqlstate '02000';
-declare exit handler for create set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create condition for sqlstate '02000';
-declare exit handler for create set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cross condition for sqlstate '02000';
-declare exit handler for cross set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross condition for sqlstate '02000';
-declare exit handler for cross set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_date condition for sqlstate '02000';
-declare exit handler for current_date set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date condition for sqlstate '02000';
-declare exit handler for current_da' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_time condition for sqlstate '02000';
-declare exit handler for current_time set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time condition for sqlstate '02000';
-declare exit handler for current_ti' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_timestamp condition for sqlstate '02000';
-declare exit handler for current_timestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp condition for sqlstate '02000';
-declare exit handler for curre' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_user condition for sqlstate '02000';
-declare exit handler for current_user set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user condition for sqlstate '02000';
-declare exit handler for current_us' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cursor condition for sqlstate '02000';
-declare exit handler for cursor set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor condition for sqlstate '02000';
-declare exit handler for cursor set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare database condition for sqlstate '02000';
-declare exit handler for database set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database condition for sqlstate '02000';
-declare exit handler for database set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare databases condition for sqlstate '02000';
-declare exit handler for databases set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases condition for sqlstate '02000';
-declare exit handler for databases set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_hour condition for sqlstate '02000';
-declare exit handler for day_hour set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour condition for sqlstate '02000';
-declare exit handler for day_hour set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_microsecond condition for sqlstate '02000';
-declare exit handler for day_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond condition for sqlstate '02000';
-declare exit handler for day_mic' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_minute condition for sqlstate '02000';
-declare exit handler for day_minute set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute condition for sqlstate '02000';
-declare exit handler for day_minute s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_second condition for sqlstate '02000';
-declare exit handler for day_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second condition for sqlstate '02000';
-declare exit handler for day_second s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dec condition for sqlstate '02000';
-declare exit handler for dec set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec condition for sqlstate '02000';
-declare exit handler for dec set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal condition for sqlstate '02000';
-declare exit handler for decimal set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal condition for sqlstate '02000';
-declare exit handler for decimal set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare declare condition for sqlstate '02000';
-declare exit handler for declare set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare condition for sqlstate '02000';
-declare exit handler for declare set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare default condition for sqlstate '02000';
-declare exit handler for default set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default condition for sqlstate '02000';
-declare exit handler for default set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delayed condition for sqlstate '02000';
-declare exit handler for delayed set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed condition for sqlstate '02000';
-declare exit handler for delayed set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delete condition for sqlstate '02000';
-declare exit handler for delete set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete condition for sqlstate '02000';
-declare exit handler for delete set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare desc condition for sqlstate '02000';
-declare exit handler for desc set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc condition for sqlstate '02000';
-declare exit handler for desc set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare describe condition for sqlstate '02000';
-declare exit handler for describe set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe condition for sqlstate '02000';
-declare exit handler for describe set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare deterministic condition for sqlstate '02000';
-declare exit handler for deterministic set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic condition for sqlstate '02000';
-declare exit handler for determini' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinct condition for sqlstate '02000';
-declare exit handler for distinct set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct condition for sqlstate '02000';
-declare exit handler for distinct set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinctrow condition for sqlstate '02000';
-declare exit handler for distinctrow set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow condition for sqlstate '02000';
-declare exit handler for distinctrow' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare div condition for sqlstate '02000';
-declare exit handler for div set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div condition for sqlstate '02000';
-declare exit handler for div set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double condition for sqlstate '02000';
-declare exit handler for double set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double condition for sqlstate '02000';
-declare exit handler for double set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare drop condition for sqlstate '02000';
-declare exit handler for drop set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop condition for sqlstate '02000';
-declare exit handler for drop set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dual condition for sqlstate '02000';
-declare exit handler for dual set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual condition for sqlstate '02000';
-declare exit handler for dual set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare each condition for sqlstate '02000';
-declare exit handler for each set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each condition for sqlstate '02000';
-declare exit handler for each set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare else condition for sqlstate '02000';
-declare exit handler for else set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else condition for sqlstate '02000';
-declare exit handler for else set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare elseif condition for sqlstate '02000';
-declare exit handler for elseif set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif condition for sqlstate '02000';
-declare exit handler for elseif set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enclosed condition for sqlstate '02000';
-declare exit handler for enclosed set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed condition for sqlstate '02000';
-declare exit handler for enclosed set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare escaped condition for sqlstate '02000';
-declare exit handler for escaped set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped condition for sqlstate '02000';
-declare exit handler for escaped set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exists condition for sqlstate '02000';
-declare exit handler for exists set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists condition for sqlstate '02000';
-declare exit handler for exists set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exit condition for sqlstate '02000';
-declare exit handler for exit set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for exit set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare explain condition for sqlstate '02000';
-declare exit handler for explain set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain condition for sqlstate '02000';
-declare exit handler for explain set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare false condition for sqlstate '02000';
-declare exit handler for false set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false condition for sqlstate '02000';
-declare exit handler for false set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fetch condition for sqlstate '02000';
-declare exit handler for fetch set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch condition for sqlstate '02000';
-declare exit handler for fetch set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float condition for sqlstate '02000';
-declare exit handler for float set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float condition for sqlstate '02000';
-declare exit handler for float set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float4 condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 condition for sqlstate '02000';
-declare exit handler for add set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float8 condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 condition for sqlstate '02000';
-declare exit handler for add set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare for condition for sqlstate '02000';
-declare exit handler for for set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for condition for sqlstate '02000';
-declare exit handler for for set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare force condition for sqlstate '02000';
-declare exit handler for force set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force condition for sqlstate '02000';
-declare exit handler for force set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare foreign condition for sqlstate '02000';
-declare exit handler for foreign set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign condition for sqlstate '02000';
-declare exit handler for foreign set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare from condition for sqlstate '02000';
-declare exit handler for from set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from condition for sqlstate '02000';
-declare exit handler for from set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fulltext condition for sqlstate '02000';
-declare exit handler for fulltext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext condition for sqlstate '02000';
-declare exit handler for fulltext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare grant condition for sqlstate '02000';
-declare exit handler for grant set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant condition for sqlstate '02000';
-declare exit handler for grant set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare group condition for sqlstate '02000';
-declare exit handler for group set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group condition for sqlstate '02000';
-declare exit handler for group set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare having condition for sqlstate '02000';
-declare exit handler for having set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having condition for sqlstate '02000';
-declare exit handler for having set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare high_priority condition for sqlstate '02000';
-declare exit handler for high_priority set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority condition for sqlstate '02000';
-declare exit handler for high_prio' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_microsecond condition for sqlstate '02000';
-declare exit handler for hour_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond condition for sqlstate '02000';
-declare exit handler for hour_m' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_minute condition for sqlstate '02000';
-declare exit handler for hour_minute set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute condition for sqlstate '02000';
-declare exit handler for hour_minute' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_second condition for sqlstate '02000';
-declare exit handler for hour_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second condition for sqlstate '02000';
-declare exit handler for hour_second' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare if condition for sqlstate '02000';
-declare exit handler for if set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if condition for sqlstate '02000';
-declare exit handler for if set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ignore condition for sqlstate '02000';
-declare exit handler for ignore set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore condition for sqlstate '02000';
-declare exit handler for ignore set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare in condition for sqlstate '02000';
-declare exit handler for in set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in condition for sqlstate '02000';
-declare exit handler for in set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare index condition for sqlstate '02000';
-declare exit handler for index set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index condition for sqlstate '02000';
-declare exit handler for index set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare infile condition for sqlstate '02000';
-declare exit handler for infile set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile condition for sqlstate '02000';
-declare exit handler for infile set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inner condition for sqlstate '02000';
-declare exit handler for inner set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner condition for sqlstate '02000';
-declare exit handler for inner set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inout condition for sqlstate '02000';
-declare exit handler for inout set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout condition for sqlstate '02000';
-declare exit handler for inout set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insensitive condition for sqlstate '02000';
-declare exit handler for insensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive condition for sqlstate '02000';
-declare exit handler for insensitive' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insert condition for sqlstate '02000';
-declare exit handler for insert set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert condition for sqlstate '02000';
-declare exit handler for insert set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int1 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int2 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int3 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int4 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int8 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare integer condition for sqlstate '02000';
-declare exit handler for integer set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer condition for sqlstate '02000';
-declare exit handler for integer set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare interval condition for sqlstate '02000';
-declare exit handler for interval set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval condition for sqlstate '02000';
-declare exit handler for interval set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare into condition for sqlstate '02000';
-declare exit handler for into set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into condition for sqlstate '02000';
-declare exit handler for into set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare is condition for sqlstate '02000';
-declare exit handler for is set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is condition for sqlstate '02000';
-declare exit handler for is set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare iterate condition for sqlstate '02000';
-declare exit handler for iterate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate condition for sqlstate '02000';
-declare exit handler for iterate set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare join condition for sqlstate '02000';
-declare exit handler for join set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join condition for sqlstate '02000';
-declare exit handler for join set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare key condition for sqlstate '02000';
-declare exit handler for key set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key condition for sqlstate '02000';
-declare exit handler for key set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare keys condition for sqlstate '02000';
-declare exit handler for keys set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys condition for sqlstate '02000';
-declare exit handler for keys set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare kill condition for sqlstate '02000';
-declare exit handler for kill set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill condition for sqlstate '02000';
-declare exit handler for kill set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leading condition for sqlstate '02000';
-declare exit handler for leading set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading condition for sqlstate '02000';
-declare exit handler for leading set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leave condition for sqlstate '02000';
-declare exit handler for leave set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave condition for sqlstate '02000';
-declare exit handler for leave set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare left condition for sqlstate '02000';
-declare exit handler for left set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left condition for sqlstate '02000';
-declare exit handler for left set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare like condition for sqlstate '02000';
-declare exit handler for like set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like condition for sqlstate '02000';
-declare exit handler for like set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare limit condition for sqlstate '02000';
-declare exit handler for limit set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit condition for sqlstate '02000';
-declare exit handler for limit set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare linear condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear condition for sqlstate '02000';
-declare exit handler for int set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lines condition for sqlstate '02000';
-declare exit handler for lines set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines condition for sqlstate '02000';
-declare exit handler for lines set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare load condition for sqlstate '02000';
-declare exit handler for load set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load condition for sqlstate '02000';
-declare exit handler for load set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtime condition for sqlstate '02000';
-declare exit handler for localtime set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime condition for sqlstate '02000';
-declare exit handler for localtime set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtimestamp condition for sqlstate '02000';
-declare exit handler for localtimestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp condition for sqlstate '02000';
-declare exit handler for localtim' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lock condition for sqlstate '02000';
-declare exit handler for lock set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock condition for sqlstate '02000';
-declare exit handler for lock set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare long condition for sqlstate '02000';
-declare exit handler for long set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long condition for sqlstate '02000';
-declare exit handler for long set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob condition for sqlstate '02000';
-declare exit handler for longblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob condition for sqlstate '02000';
-declare exit handler for longblob set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext condition for sqlstate '02000';
-declare exit handler for longtext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext condition for sqlstate '02000';
-declare exit handler for longtext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare loop condition for sqlstate '02000';
-declare exit handler for loop set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop condition for sqlstate '02000';
-declare exit handler for loop set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare low_priority condition for sqlstate '02000';
-declare exit handler for low_priority set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority condition for sqlstate '02000';
-declare exit handler for low_priori' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare master_ssl_verify_server_cert condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert condition for sqlstate '02000';
-declare exit handl' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare match condition for sqlstate '02000';
-declare exit handler for match set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match condition for sqlstate '02000';
-declare exit handler for match set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob condition for sqlstate '02000';
-declare exit handler for mediumblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob condition for sqlstate '02000';
-declare exit handler for mediumblob s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint condition for sqlstate '02000';
-declare exit handler for mediumint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint condition for sqlstate '02000';
-declare exit handler for mediumint set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext condition for sqlstate '02000';
-declare exit handler for mediumtext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext condition for sqlstate '02000';
-declare exit handler for mediumtext s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare middleint condition for sqlstate '02000';
-declare exit handler for middleint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint condition for sqlstate '02000';
-declare exit handler for middleint set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_microsecond condition for sqlstate '02000';
-declare exit handler for minute_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond condition for sqlstate '02000';
-declare exit handler for minu' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_second condition for sqlstate '02000';
-declare exit handler for minute_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second condition for sqlstate '02000';
-declare exit handler for minute_se' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mod condition for sqlstate '02000';
-declare exit handler for mod set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod condition for sqlstate '02000';
-declare exit handler for mod set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare modifies condition for sqlstate '02000';
-declare exit handler for modifies set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies condition for sqlstate '02000';
-declare exit handler for modifies set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare natural condition for sqlstate '02000';
-declare exit handler for natural set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural condition for sqlstate '02000';
-declare exit handler for natural set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare not condition for sqlstate '02000';
-declare exit handler for not set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not condition for sqlstate '02000';
-declare exit handler for not set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare no_write_to_binlog condition for sqlstate '02000';
-declare exit handler for no_write_to_binlog set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog condition for sqlstate '02000';
-declare exit handler for no_w' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare null condition for sqlstate '02000';
-declare exit handler for null set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null condition for sqlstate '02000';
-declare exit handler for null set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric condition for sqlstate '02000';
-declare exit handler for numeric set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric condition for sqlstate '02000';
-declare exit handler for numeric set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare on condition for sqlstate '02000';
-declare exit handler for on set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on condition for sqlstate '02000';
-declare exit handler for on set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optimize condition for sqlstate '02000';
-declare exit handler for optimize set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize condition for sqlstate '02000';
-declare exit handler for optimize set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare option condition for sqlstate '02000';
-declare exit handler for option set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option condition for sqlstate '02000';
-declare exit handler for option set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optionally condition for sqlstate '02000';
-declare exit handler for optionally set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally condition for sqlstate '02000';
-declare exit handler for optionally s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare or condition for sqlstate '02000';
-declare exit handler for or set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or condition for sqlstate '02000';
-declare exit handler for or set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare order condition for sqlstate '02000';
-declare exit handler for order set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order condition for sqlstate '02000';
-declare exit handler for order set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare out condition for sqlstate '02000';
-declare exit handler for out set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out condition for sqlstate '02000';
-declare exit handler for out set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outer condition for sqlstate '02000';
-declare exit handler for outer set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer condition for sqlstate '02000';
-declare exit handler for outer set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outfile condition for sqlstate '02000';
-declare exit handler for outfile set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile condition for sqlstate '02000';
-declare exit handler for outfile set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare precision condition for sqlstate '02000';
-declare exit handler for precision set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision condition for sqlstate '02000';
-declare exit handler for precision set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare primary condition for sqlstate '02000';
-declare exit handler for primary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary condition for sqlstate '02000';
-declare exit handler for primary set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare procedure condition for sqlstate '02000';
-declare exit handler for procedure set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure condition for sqlstate '02000';
-declare exit handler for procedure set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare purge condition for sqlstate '02000';
-declare exit handler for purge set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge condition for sqlstate '02000';
-declare exit handler for purge set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare range condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read condition for sqlstate '02000';
-declare exit handler for read set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read condition for sqlstate '02000';
-declare exit handler for read set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare reads condition for sqlstate '02000';
-declare exit handler for reads set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads condition for sqlstate '02000';
-declare exit handler for reads set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_only condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int set @var2 = 1;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_write condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write condition for sqlstate '02000';
-declare exit handler for int set @var' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real condition for sqlstate '02000';
-declare exit handler for real set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real condition for sqlstate '02000';
-declare exit handler for real set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare references condition for sqlstate '02000';
-declare exit handler for references set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references condition for sqlstate '02000';
-declare exit handler for references s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare regexp condition for sqlstate '02000';
-declare exit handler for regexp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp condition for sqlstate '02000';
-declare exit handler for regexp set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare release condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release condition for sqlstate '02000';
-declare exit handler for int set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rename condition for sqlstate '02000';
-declare exit handler for rename set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename condition for sqlstate '02000';
-declare exit handler for rename set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare repeat condition for sqlstate '02000';
-declare exit handler for repeat set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat condition for sqlstate '02000';
-declare exit handler for repeat set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare replace condition for sqlstate '02000';
-declare exit handler for replace set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace condition for sqlstate '02000';
-declare exit handler for replace set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare require condition for sqlstate '02000';
-declare exit handler for require set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require condition for sqlstate '02000';
-declare exit handler for require set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare restrict condition for sqlstate '02000';
-declare exit handler for restrict set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict condition for sqlstate '02000';
-declare exit handler for restrict set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare return condition for sqlstate '02000';
-declare exit handler for return set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return condition for sqlstate '02000';
-declare exit handler for return set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare revoke condition for sqlstate '02000';
-declare exit handler for revoke set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke condition for sqlstate '02000';
-declare exit handler for revoke set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare right condition for sqlstate '02000';
-declare exit handler for right set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right condition for sqlstate '02000';
-declare exit handler for right set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rlike condition for sqlstate '02000';
-declare exit handler for rlike set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike condition for sqlstate '02000';
-declare exit handler for rlike set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schema condition for sqlstate '02000';
-declare exit handler for schema set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema condition for sqlstate '02000';
-declare exit handler for schema set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schemas condition for sqlstate '02000';
-declare exit handler for schemas set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas condition for sqlstate '02000';
-declare exit handler for schemas set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare second_microsecond condition for sqlstate '02000';
-declare exit handler for second_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond condition for sqlstate '02000';
-declare exit handler for seco' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare select condition for sqlstate '02000';
-declare exit handler for SELECT set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select condition for sqlstate '02000';
-declare exit handler for SELECT set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sensitive condition for sqlstate '02000';
-declare exit handler for sensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive condition for sqlstate '02000';
-declare exit handler for sensitive set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare separator condition for sqlstate '02000';
-declare exit handler for separator set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator condition for sqlstate '02000';
-declare exit handler for separator set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set condition for sqlstate '02000';
-declare exit handler for set set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set condition for sqlstate '02000';
-declare exit handler for set set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare show condition for sqlstate '02000';
-declare exit handler for show set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show condition for sqlstate '02000';
-declare exit handler for show set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint condition for sqlstate '02000';
-declare exit handler for smallint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint condition for sqlstate '02000';
-declare exit handler for smallint set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare spatial condition for sqlstate '02000';
-declare exit handler for spatial set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial condition for sqlstate '02000';
-declare exit handler for spatial set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare specific condition for sqlstate '02000';
-declare exit handler for specific set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific condition for sqlstate '02000';
-declare exit handler for specific set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql condition for sqlstate '02000';
-declare exit handler for sql set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql condition for sqlstate '02000';
-declare exit handler for sql set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlexception condition for sqlstate '02000';
-declare exit handler for sqlexception set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception condition for sqlstate '02000';
-declare exit handler for sqlexcepti' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlstate condition for sqlstate '02000';
-declare exit handler for sqlstate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate condition for sqlstate '02000';
-declare exit handler for sqlstate set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlwarning condition for sqlstate '02000';
-declare exit handler for sqlwarning set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning condition for sqlstate '02000';
-declare exit handler for sqlwarning s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_big_result condition for sqlstate '02000';
-declare exit handler for sql_big_result set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result condition for sqlstate '02000';
-declare exit handler for sql_big_' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_calc_found_rows condition for sqlstate '02000';
-declare exit handler for sql_calc_found_rows set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows condition for sqlstate '02000';
-declare exit handler for sql' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_small_result condition for sqlstate '02000';
-declare exit handler for sql_small_result set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result condition for sqlstate '02000';
-declare exit handler for sql_sm' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ssl condition for sqlstate '02000';
-declare exit handler for ssl set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl condition for sqlstate '02000';
-declare exit handler for ssl set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare starting condition for sqlstate '02000';
-declare exit handler for starting set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting condition for sqlstate '02000';
-declare exit handler for starting set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare straight_join condition for sqlstate '02000';
-declare exit handler for straight_join set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join condition for sqlstate '02000';
-declare exit handler for straight_' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare table condition for sqlstate '02000';
-declare exit handler for table set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table condition for sqlstate '02000';
-declare exit handler for table set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare terminated condition for sqlstate '02000';
-declare exit handler for terminated set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated condition for sqlstate '02000';
-declare exit handler for terminated s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare then condition for sqlstate '02000';
-declare exit handler for then set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then condition for sqlstate '02000';
-declare exit handler for then set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob condition for sqlstate '02000';
-declare exit handler for tinyblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob condition for sqlstate '02000';
-declare exit handler for tinyblob set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint condition for sqlstate '02000';
-declare exit handler for tinyint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint condition for sqlstate '02000';
-declare exit handler for tinyint set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext condition for sqlstate '02000';
-declare exit handler for tinytext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext condition for sqlstate '02000';
-declare exit handler for tinytext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare to condition for sqlstate '02000';
-declare exit handler for to set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to condition for sqlstate '02000';
-declare exit handler for to set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trailing condition for sqlstate '02000';
-declare exit handler for trailing set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing condition for sqlstate '02000';
-declare exit handler for trailing set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trigger condition for sqlstate '02000';
-declare exit handler for trigger set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger condition for sqlstate '02000';
-declare exit handler for trigger set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare true condition for sqlstate '02000';
-declare exit handler for true set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true condition for sqlstate '02000';
-declare exit handler for true set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare undo condition for sqlstate '02000';
-declare exit handler for undo set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo condition for sqlstate '02000';
-declare exit handler for undo set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare union condition for sqlstate '02000';
-declare exit handler for union set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union condition for sqlstate '02000';
-declare exit handler for union set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unique condition for sqlstate '02000';
-declare exit handler for unique set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique condition for sqlstate '02000';
-declare exit handler for unique set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unlock condition for sqlstate '02000';
-declare exit handler for unlock set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock condition for sqlstate '02000';
-declare exit handler for unlock set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unsigned condition for sqlstate '02000';
-declare exit handler for unsigned set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned condition for sqlstate '02000';
-declare exit handler for unsigned set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare update condition for sqlstate '02000';
-declare exit handler for update set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update condition for sqlstate '02000';
-declare exit handler for update set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare usage condition for sqlstate '02000';
-declare exit handler for usage set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage condition for sqlstate '02000';
-declare exit handler for usage set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare use condition for sqlstate '02000';
-declare exit handler for USE set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use condition for sqlstate '02000';
-declare exit handler for USE set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare using condition for sqlstate '02000';
-declare exit handler for using set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using condition for sqlstate '02000';
-declare exit handler for using set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_date condition for sqlstate '02000';
-declare exit handler for utc_date set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date condition for sqlstate '02000';
-declare exit handler for utc_date set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_time condition for sqlstate '02000';
-declare exit handler for utc_time set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time condition for sqlstate '02000';
-declare exit handler for utc_time set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_timestamp condition for sqlstate '02000';
-declare exit handler for utc_timestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp condition for sqlstate '02000';
-declare exit handler for utc_times' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare values condition for sqlstate '02000';
-declare exit handler for values set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values condition for sqlstate '02000';
-declare exit handler for values set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varbinary condition for sqlstate '02000';
-declare exit handler for varbinary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary condition for sqlstate '02000';
-declare exit handler for varbinary set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varchar condition for sqlstate '02000';
-declare exit handler for varchar set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar condition for sqlstate '02000';
-declare exit handler for varchar set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varcharacter condition for sqlstate '02000';
-declare exit handler for varcharacter set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter condition for sqlstate '02000';
-declare exit handler for varcharact' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varying condition for sqlstate '02000';
-declare exit handler for varying set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying condition for sqlstate '02000';
-declare exit handler for varying set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare when condition for sqlstate '02000';
-declare exit handler for when set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when condition for sqlstate '02000';
-declare exit handler for when set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare where condition for sqlstate '02000';
-declare exit handler for where set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where condition for sqlstate '02000';
-declare exit handler for where set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare while condition for sqlstate '02000';
-declare exit handler for while set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while condition for sqlstate '02000';
-declare exit handler for while set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare with condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare write condition for sqlstate '02000';
-declare exit handler for write set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write condition for sqlstate '02000';
-declare exit handler for write set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare xor condition for sqlstate '02000';
-declare exit handler for xor set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor condition for sqlstate '02000';
-declare exit handler for xor set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year_month condition for sqlstate '02000';
-declare exit handler for year_month set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month condition for sqlstate '02000';
-declare exit handler for year_month s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare zerofill condition for sqlstate '02000';
-declare exit handler for zerofill set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill condition for sqlstate '02000';
-declare exit handler for zerofill set @' at line 3
-
-Testcase :
-----------
-Ensure that every possible type of handler may be declared for
-a stored procedure (continue- handler_type ).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t2(f1) values (1);
-set @x = 2;
-insert into t2(f1) values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare undo handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t values ' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare continueinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare undoinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare exitinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare accessible handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare add handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare all handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare alter handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare analyze handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare and handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare as handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asc handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare before handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare between handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare both handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare by handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare call handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cascade handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare case handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare change handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare character handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare check handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare collate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare column handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare condition handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare constraint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare continue handler for sqlstate '02000' set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare convert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare create handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cross handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_date handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_time handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_timestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_user handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cursor handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare database handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare databases handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_hour handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_minute handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dec handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare declare handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare default handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delayed handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delete handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare desc handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare describe handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare deterministic handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinct handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinctrow handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare div handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare drop handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dual handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare each handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare else handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare elseif handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enclosed handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare escaped handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exists handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exit handler for sqlstate '02000' set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare explain handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare false handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fetch handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float4 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float8 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare for handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare force handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare foreign handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare from handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fulltext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare grant handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare group handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare having handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare high_priority handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_minute handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare if handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ignore handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare in handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare index handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare infile handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inner handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inout handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int1 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int2 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int3 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int4 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int8 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare integer handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare interval handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare into handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare is handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare iterate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare join handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare key handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare keys handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare kill handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leading handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leave handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare left handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare like handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare limit handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare linear handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lines handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare load handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtime handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtimestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lock handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare long handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare loop handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare low_priority handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare master_ssl_verify_server_cert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare match handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare middleint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mod handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare modifies handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare natural handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare not handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare no_write_to_binlog handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare null handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare on handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optimize handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare option handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optionally handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare or handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare order handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare out handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outer handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outfile handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare precision handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare primary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare privileges handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare procedure handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare purge handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare range handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare reads handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_only handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_write handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare references handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare regexp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare release handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rename handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare repeat handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare replace handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare require handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare restrict handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare return handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare revoke handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare right handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rlike handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schema handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schemas handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare second_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare select handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare separator handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare show handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare spatial handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare specific handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlexception handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlstate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlwarning handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_big_result handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_calc_found_rows handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_small_result handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ssl handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare starting handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare straight_join handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare table handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare terminated handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare then handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare to handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trailing handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trigger handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare true handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare undo handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare union handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unique handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unlock handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unsigned handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare update handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare usage handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare use handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare using handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_date handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_time handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_timestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare values handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varbinary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varchar handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varcharacter handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varying handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare when handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare where handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare while handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare with handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare write handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare xor handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year_month handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare zerofill handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-USE db_storedproc;
-
-Testcase 4.2.26:
---------------------------------------------------------------------------------
-set @v1='0';
-set @v2='0';
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x char;
-declare y char;
-declare cond1 condition for sqlstate '42000';
-declare cur1 cursor for SELECT f1 from t2 limit 1;
-declare continue handler for cond1 set @x = 4;
-set @x = '1';
-set @y = '2';
-BEGIN
-declare x char;
-declare y char;
-declare cur1 cursor for SELECT f1 from t2 limit 2, 1;
-declare continue handler for sqlstate '42000' set @x = 3;
-open cur1;
-fetch cur1 into y;
-close cur1;
-CALL nonsexist();
-SELECT x, y, @x;
-END;
-open cur1;
-fetch cur1 into y;
-close cur1;
-CALL nonsexist();
-set @v1 = @x;
-set @v2 = y;
-END//
-CALL sp1();
-x y @x
-NULL a 3
-Warnings:
-Warning 1265 Data truncated for column 'y' at row 3
-Warning 1265 Data truncated for column 'y' at row 1
-SELECT @v1, @v2;
-@v1 @v2
-4 a
-DROP PROCEDURE sp1;
-
-Testcase 4.2.28:
---------------------------------------------------------------------------------
-set @x=0;
-set @y=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set session sort_buffer_size = 10 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-set @x = 4;
-set @y = 3;
-set global sort_buffer_size = 2 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-set @@sort_buffer_size = 10 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-END//
-CALL sp1();
-@@sort_buffer_size
-10485760
-@@sort_buffer_size
-10485760
-@@sort_buffer_size
-10485760
-SELECT @x, @y;
-@x @y
-4 3
-
-Testcase 4.2.29:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx char default 'x';
-declare xy char default 'y';
-declare xz char default 'z';
-set @xx = xx, @xy = xy;
-set @xz = xz;
-SELECT @xx, @xy, @xz;
-END//
-CALL sp1();
-@xx @xy @xz
-x y z
-DROP PROCEDURE sp1;
-
-Testcase 4.2.30:
---------------------------------------------------------------------------------
-set @xx=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx int;
-set xx = 'asd';
-set @xx = xx;
-SELECT @xx;
-END//
-CALL sp1();
-@xx
-0
-Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx int;
-set xx = 5;
-set @xx = xx;
-SELECT @xx;
-END//
-CALL sp1();
-@xx
-5
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - a:
---------------------------------------------------------------------------------
-set @xx=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx char;
-set xx = 'temp';
-set @xx = xx;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
-SELECT @xx;
-@xx
-t
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - b:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx float;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0
-Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx float;
-set xx = 1.6;
-SELECT xx;
-END//
-CALL sp1();
-xx
-1.6
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - c:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx datetime;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0000-00-00 00:00:00
-Warnings:
-Warning 1264 Out of range value for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx datetime;
-set xx = '2006-06-06 01:01:01';
-SELECT xx;
-END//
-CALL sp1();
-xx
-2006-06-06 01:01:01
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - d:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx varchar(20);
-set xx = "abcdefghijk";
-SELECT xx;
-END//
-CALL sp1();
-xx
-abcdefghijk
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - e:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx tinyint;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0
-Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx tinyint;
-set xx = -125;
-SELECT xx;
-END//
-CALL sp1();
-xx
--125
-DROP PROCEDURE sp1;
-
-Testcase 4.2.37:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer;
-SELECT sal, f2 into x, y from t2 limit 1;
-set @x=x; set @y=y;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x char ascii;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinytext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x text;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumtext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x longtext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x blob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x longblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x binary;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x date;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x time;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x datetime;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x timestamp;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year(3);
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year(4);
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x enum("1enum", "2enum");
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x set("1set", "2set");
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.38:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare notable condition for sqlstate '42S02';
-declare continue handler for notable set @x2=1;
-set @x = 1;
-insert into t2(f1) values (1);
-set @x = 2;
-insert into t2(f1) values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.39:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42000';
-declare cond1 condition for sqlstate '23000';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values(1);
-END//
-ERROR 42000: Duplicate condition: cond1
-
-Testcase 4.2.41:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '1';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '1'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '12';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '12'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '1234';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '1234'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123456';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123456'
-
-Testcase 4.2.42:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'abcdefghi';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: 'abcdefghi'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42000test';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '42000test'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '00000@#$%^&';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '00000@#$%^&'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'null';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: 'null'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate ' ';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: ' '
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 1234567890;
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1234567890;
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '2005-03-03';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '2005-03-03'
-
-Testcase 4.2.43:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-expect failure, SQLSTATE 00000 is not an acceptable value
-for an SP's handler
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '00000';
-declare continue handler for cond1 set @var2 = 1;
-set @x=1;
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-ensure SP doesn't exist
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-
-Testcase 4.2.45:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare continue handler for sqlstate '23000' set @varr1 = 5;
-declare continue handler for sqlstate '23000' set @varr3 = 7;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare mycondition condition for sqlstate '23000';
-declare continue handler for mycondition set @varr3 = 7;
-declare continue handler for sqlstate '23000' set @varr3 = 7;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-
-Testcase 4.2.46:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '1' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '1'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '12' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '12'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '123' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '123'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '1234' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '1234'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '123456' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '123456'
-
-Testcase 4.2.47:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '42s0200test' set @var2 = 1;
-insert into tnull values( 1);
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '42s0200test'
-
-Testcase 4.2.48:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-This creation should fail, SQLSTATE 00000 is unacceptable
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '00000' set @var2 = 1;
-set @x=1;
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-Verify SP wasn't created
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTSsp1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTSsp1' at line 1
-
-Testcase 4.2.52:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare cur1 cursor for SELECT f1, f2 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newlf1, newf3, newsal;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Duplicate cursor: cur1
-
-Testcase 4.2.53:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, lf1, f3, f4 into @w, @x, @y, @z from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newlf1, newf3, newsal;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Cursor SELECT must not have INTO
-
-Testcase 4.2.54:
---------------------------------------------------------------------------------
-
-Testcase 4.2.55:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Undefined CURSOR: cur1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 0;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf3, newf4;
-set count = count - 1;
-END while;
-END;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is already open
-
-Testcase 4.2.56:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is already open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.57:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2;
-declare cur2 cursor for SELECT f1, f2 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur2;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.59:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-open cur1;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 10;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf3, newf4;
-set count = count - 1;
-END while;
-open cur1;
-close cur1;
-END;
-close cur1;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.60:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-close cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-close cur1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-open cur1;
-END;
-fetch cur1 into newf1, newf2, newf3, newf4;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.62:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf2 char(20);
-declare newf1 int1;
-declare cur1 cursor for SELECT f1, f3 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2;
-set @x = newf1;
-set @y = newf2;
-SELECT @x, @y;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-DROP PROCEDURE sp1;
-
-Testcase 4.2.63:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-close cur1;
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 0;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-open cur1;
-END;
-close cur1;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.64:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-BEGIN
-open cur1;
-start transaction;
-fetch cur1 into newf1, newf2, newf4, newf3;
-commit;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END;
-END//
-CALL sp1();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-DROP PROCEDURE sp1;
-
-Testcase 4.2.65:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-BEGIN
-open cur1;
-fetch cur1 into newf1, newf2, newf4, newf3;
-rollback;
-fetch cur1 into newf1, newf2, newf4, newf3;
-commit;
-END;
-END//
-CALL sp1();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-DROP PROCEDURE sp1;
-
-Testcase 4.2.66:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.67:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-# set count = count - 1;
-# while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-# set count = count - 1;
-# END while;
-END;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.70:
---------------------------------------------------------------------------------
-create table temp1( f1 char(20), f2 char(20), f3 int, f4 char(20) );
-create table temp2( f1 char(20), f2 char(20), f3 int, f4 char(20) );
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare newf21 char(20);
-declare newf22 char(20);
-declare newf23 char(20);
-declare newf24 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 7, 1;
-declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 15, 1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-BEGIN
-set count = 10;
-BEGIN
-open cur2;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-END;
-insert into temp1 values(newf1, newf2, newf4, newf3);
-close cur1;
-END;
-BEGIN
-set count = 10;
-while count > 0 do
-fetch cur2 into newf21, newf22, newf24, newf23;
-set count = count - 1;
-END while;
-END;
-insert into temp2 values(newf21, newf22, newf24, newf23);
-close cur2;
-END//
-CALL sp1();
-SELECT count(*) from temp1;
-count(*)
-1
-SELECT * from temp2;
-f1 f2 f3 f4
-NULL NULL NULL NULL
-DROP PROCEDURE sp1;
-drop table temp1;
-drop table temp2;
-
-Section 3.1.3 - Syntax checks for the stored procedure-specific flow control statements
-. IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.3.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP TABLE IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742(
-middleinitial CHAR, lastname VARCHAR(50),
-age_averylongfieldname_averylongname_1234569 INT, COMMENT VARCHAR(100))
-ENGINE=<engine_to_be_tested>;
-INSERT INTO res_t3_itisalongname_1381742_itsaverylongname_1381742
-VALUES('a', 'aaaaaaaaaabbbbbbbbc', 0, 'default');
-CREATE PROCEDURE sp1(a INT)
-BEGIN
-DECLARE itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx CHAR;
-DECLARE itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx VARCHAR(100);
-DECLARE itisjustamediumsizeintintegervariablename INTEGER;
-SET itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx = 'b';
-SET itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx
-= 'oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@%';
-SET itisjustamediumsizeintintegervariablename = 5;
-SET @comment='a';
-label1: LOOP
-IF a > 100 THEN
-SET @comment = 'value of a is greater than 100';
-ELSEIF a < 100 THEN
-IF a < 50 THEN
-SET @comment = 'value of a is less than 50';
-ELSEIF a < 25 THEN
-SET @comment = 'value of a is less than 25';
-ELSE
-SET @comment = 'value of a is greater than 50 and less than 100';
-END IF;
-ELSE
-SET @comment = 'value of a is 100';
-END IF;
-IF itisjustamediumsizeintintegervariablename = 0 THEN LEAVE label1;
-END IF;
-INSERT INTO res_t3_itisalongname_1381742_itsaverylongname_1381742
-VALUES(itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx,
-CONCAT(itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx,
-' ', a), a, @comment);
-SET itisjustamediumsizeintintegervariablename
-= itisjustamediumsizeintintegervariablename - 1;
-ITERATE label1;
-END LOOP label1;
-END//
-CALL sp1(101);
-CALL sp1(100);
-CALL sp1(75);
-CALL sp1(40);
-CALL sp1(20);
-CALL sp1(-1);
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742
-ORDER BY middleinitial, lastname, age_averylongfieldname_averylongname_1234569;
-middleinitial lastname age_averylongfieldname_averylongname_1234569 COMMENT
-a aaaaaaaaaabbbbbbbbc 0 default
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE sp1;
-
-Testcase 4.3.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( action char(20) )
-BEGIN
-declare v1 char(20);
-declare v2 char(20);
-declare count integer;
-set v1 = 'f1';
-set v2 = 'address';
-set count = 1;
-case when action = 'delete' then
-insert into t3 values(v1, v2, count);
-delete from t3 where f1=v1;
-when action = 'insert' then
-repeat
-insert into t3 values(v1, v2, count);
-set count = count + 1;
-until count > 5
-END repeat;
-set count = 1;
-label1: repeat
-insert into t3 values(v1, v2, count);
-if count > 5 then leave label1;
-END if;
-set count = count + 1;
-until count > 5
-END repeat;
-set count = 1;
-while count < 5 do
-insert into t3 values(v1, v2, count);
-set count = count + 1;
-END while;
-set count = 1;
-label1: while count < 5 do
-insert into t3 values(v1, v2, count);
-if count > 5 then leave label1;
-END if;
-set count = count + 1;
-END while;
-else
-set @dummystring = 'temp value';
-END case;
-END//
-CALL sp2( 'insert' );
-SELECT * from t3 where f3 <=5 && f3 >= 0;
-f1 f2 f3
-f1 address 1
-f1 address 1
-f1 address 1
-f1 address 1
-f1 address 2
-f1 address 2
-f1 address 2
-f1 address 2
-f1 address 3
-f1 address 3
-f1 address 3
-f1 address 3
-f1 address 4
-f1 address 4
-f1 address 4
-f1 address 4
-f1 address 5
-f1 address 5
-SELECT count(*) from t3;
-count(*)
-28
-CALL sp2( 'delete' );
-SELECT count(*) from t3;
-count(*)
-10
-CALL sp2 ('test');
-SELECT @dummystring;
-@dummystring
-temp value
-DROP PROCEDURE sp2;
-
-Testcase 4.1.2:
----------------
-Ensure that all sub-clauses that should not be supported are disallowed with
-an appropriate error message. (case)
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp3;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742 (name char, address varchar(50), age_averylongfieldname_averylongname_1234569 smallint);
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-label1: case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsav' at line 3
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-label1: BEGIN
-case
-action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-END label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set' at line 5
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-then action = 'truncate' when
-truncate from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then action = 'truncate' when
-truncate from res_t3_itisalongname_1381742_itsave' at line 6
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-declare v1 char(20);
-declare v2 char(20);
-declare count integer;
-set v1 = 'f1';
-set v2= 'address';
-set count = 1;
-case action
-when 'delete' then
-when 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_13' at line 11
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-declare count int default 1;
-declare done int default 0;
-declare continue handler for sqlstate 'HY000' set done=1;
-label1: loop
-case
-when action = 'delete' then
-label3:BEGIN
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-END label3;
-when action = 'insert' then
-label2: while count < 10 do
-BEGIN
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742
-values('xxxxxxxxxxxxxxxxxxx', '1231230981(*&(*&)(*&(', count);
-set count = count + 1;
-if count= 10 then
-set done=1;
-END if;
-END;
-END while label2;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-if done=1 then
-leave label1;
-END if;
-END loop label1;
-SELECT count, done;
-END//
-CALL sp3('insert');
-count done
-10 1
-Warnings:
-Warning 1265 Data truncated for column 'name' at row 1
-Warning 1265 Data truncated for column 'name' at row 2
-Warning 1265 Data truncated for column 'name' at row 3
-Warning 1265 Data truncated for column 'name' at row 4
-Warning 1265 Data truncated for column 'name' at row 5
-Warning 1265 Data truncated for column 'name' at row 6
-Warning 1265 Data truncated for column 'name' at row 7
-Warning 1265 Data truncated for column 'name' at row 8
-Warning 1265 Data truncated for column 'name' at row 9
-DROP PROCEDURE sp3;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-if count > 10 then leave label1;
-else
-set count = count + 1;
-elseif count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-EN' at line 9
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-else
-set count = count + 1;
-if count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else
-set count = count + 1;
-if count > 20 then
-leave label1;
-END if;
-iterate lab' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-elseif count > 20 then
-leave label1;
-else
-set count=count+1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif count > 20 then
-leave label1;
-else
-set count=count+1;
-END if;
-iterate lab' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-END if;
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END if;
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare i int default 10;
-if i > 20 then
-set i=25;
-END if
-declare count int;
-set count = 1;
-label1: loop
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare count int;
-set count = 1;
-label1: loop
-if count > 20 then
-leave label1;
-' at line 7
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare idummy int default 10;
-declare count int;
-set count = 1;
-label1: loop
-BEGIN
-if count < 20 then
-BEGIN
-declare idummy2 int default 10;
-set count=count+1;
-END;
-else
-BEGIN
-SELECT idummy2;
-leave label1;
-END;
-END if;
-iterate label1;
-END;
-END loop label1;
-END//
-CALL sp4();
-ERROR 42S22: Unknown column 'idummy2' in 'field list'
-DROP PROCEDURE sp4;
-
-Testcase 4.3.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5()
-BEGIN
-declare count integer default 1;
-set count = 1;
-case
-else
-set count = 10;
-when count = 1 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else
-set count = 10;
-when count = 1 then
-set count = count + 1;
-END case;
-END' at line 6
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-when case count = 1 then
-set count = 10;
-when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when case count = 1 then
-set count = 10;
-when count = 2 then
-set count = count' at line 3
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-END case;
-when count = 1 then
-set count = 10;
-when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case;
-when count = 1 then
-set count = 10;
-when count = 2 then
-set count = coun' at line 3
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-when count = 1 then
-set count = 10;
-case when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when count = 1 then
-set count = 10;
-case when count = 2 then
-set count = count' at line 3
-
-Testcase 4.3.6:
----------------
-Ensure that all supported sub-clauses are supported only in the correct order (repeat).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-until count1 > 5
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat;
-until count1 > 5
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: until count1 > 5
-repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'until count1 > 5
-repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1' at line 4
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: END repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-until count1 > 5
-repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-unt' at line 4
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-until count1 > 10;
-SELECT count1;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-SELECT count1;
-END repeat;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1-1;
-until count1 < 0
-END repeat label1;
-SELECT count1;
-END//
-CALL sp6();
-count1
--1
-DROP PROCEDURE sp6;
-
-Testcase 4.3.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: loop
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-label1 iterate;
-END label1 loop;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate;
-END label1 loop;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: END loop;
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-iterate label1;
-loop;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END loop;
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END ' at line 3
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: iterate label1;
-loop
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate label1;
-loop
-set @dummystring = 'temp value';
-if count > 10 then leave l' at line 3
-
-Testcase 4.3.8:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-do while v1 > 0
-set v1 = v1 - 1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while v1 > 0
-set v1 = v1 - 1;
-END while;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-do v1 > 0 while
-set v1 = v1 - 1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while
-set v1 = v1 - 1;
-END while;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-END while;
-set v1 = v1 - 1;
-while v1 > 0 do;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while;
-set v1 = v1 - 1;
-while v1 > 0 do;
-END' at line 4
-
-Testcase 4.3.12:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp12;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp12( )
-BEGIN
-declare count1 integer default 1;
-declare count2 int;
-label1: loop
-if count1 > 2 then leave label1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-label2: loop
-if count2 > 2 then leave label2;
-END if;
-set count2 = count2 + 1;
-END loop label1;
-set count1 = count1 + 1;
-iterate label1;
-END loop label2;
-END//
-ERROR 42000: End-label label1 without match
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.13:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp13;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp13( )
-BEGIN
-declare count1 integer default 1;
-lable1: loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop;
-END//
-CALL sp13();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 1
-xyz pqr 2
-DROP PROCEDURE sp13;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.14:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp14;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp14( )
-BEGIN
-declare count1 integer default 1;
-loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop label1;
-END//
-ERROR 42000: LEAVE with no matching label: lable1
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.15:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp15;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp15( )
-BEGIN
-declare count1 integer default 1;
-label1 loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1' at line 4
-
-Testcase 4.3.16:
-----------------
-Ensure that every beginning label with the same scope must be unique.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp16;
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE PROCEDURE sp16( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-set count2 = 1;
-label1: repeat
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( xyz , pqr, count1);
-until count2 > 3
-END repeat label1;
-until count1 > 3
-END repeat label1;
-END//
-ERROR 42000: Redefining label label1
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-declare count3 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-label1: repeat
-set count2 = count2 + 1;
-SELECT count2;
-until count2 > 3
-END repeat label1;
-SELECT count1;
-until count1 > 3
-END repeat label1;
-label1: repeat
-set count3 = count3 + 1;
-SELECT count3;
-until count3 > 3
-END repeat label1;
-END//
-ERROR 42000: Redefining label label1
-
-Testcase 4.3.17:
---------------------------------------------------------------------------------
-
-Testcase 4.3.18:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp18;
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE PROCEDURE sp18( )
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat label2;
-END//
-ERROR 42000: End-label label2 without match
-
-Testcase 4.3.19:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp19;
-CREATE PROCEDURE sp19( )
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat;
-END//
-CALL sp19();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-DROP PROCEDURE sp19;
-
-Testcase 4.3.20:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp20;
-CREATE PROCEDURE sp20( )
-BEGIN
-declare count1 integer default 1;
-repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'label1;
-END' at line 8
-
-Testcase 4.3.21:
---------------------------------------------------------------------------------
-
-Testcase 4.3.22:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-label1: while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while label2;
-END while;
-END//
-ERROR 42000: End-label label2 without match
-
-Testcase 4.3.23:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while label1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'label1;
-END while;
-END' at line 11
-
-Testcase 4.3.25:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-label1: while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while;
-END while;
-END//
-CALL sp25 ();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-xyz pqr 2
-xyz pqr 3
-xyz pqr 3
-DROP PROCEDURE sp25;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Section 3.1.4 - Checks for the global nature of stored procedures:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.4.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP DATABASE IF EXISTS d40401;
-CREATE PROCEDURE sp1 ( n char(20) )
-BEGIN
-SELECT n;
-END//
-CREATE DATABASE d40401;
-USE d40401;
-CALL db_storedproc.sp1('abcd');
-n
-abcd
-USE db_storedproc;
-DROP PROCEDURE sp1;
-DROP DATABASE d40401;
-
-Testcase 4.4.2:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-DROP FUNCTION IF EXISTS fn11;
-DROP DATABASE IF EXISTS d40402;
-CREATE FUNCTION fn1(n int) returns int
-BEGIN
-declare a int;
-set a = 9 * n;
-return a;
-END//
-CREATE DATABASE d40402;
-USE d40402;
-SELECT db_storedproc.fn1(100);
-db_storedproc.fn1(100)
-900
-SELECT db_storedproc.fn1(1000);
-db_storedproc.fn1(1000)
-9000
-CREATE FUNCTION db_storedproc.fn11(n int) returns int
-BEGIN
-declare a int;
-set a = 9 * n;
-return a;
-END//
-SELECT db_storedproc.fn11(100);
-db_storedproc.fn11(100)
-900
-SELECT db_storedproc.fn11(1000);
-db_storedproc.fn11(1000)
-9000
-USE db_storedproc;
-DROP FUNCTION fn1;
-DROP FUNCTION fn11;
-DROP DATABASE d40402;
-
-Testcase 4.4.3:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-DROP DATABASE IF EXISTS d2;
-CREATE DATABASE d1;
-CREATE DATABASE d2;
-USE d1;
-create table res_t41(a char(5), b char(10));
-insert into res_t41 values('abcde', 'a!@#$%^&*(');
-USE d2;
-create table res_t42(a char(5), b char(10));
-USE d1;
-CREATE PROCEDURE sp2(n char (20))
-BEGIN
-SELECT res_t41.a, res_t41.b into @a, @b from res_t41 where res_t41.b = n;
-insert into d2.res_t42 values (@a, @b);
-END//
-USE d2;
-CALL d1.sp2('a!@#$%^&*(');
-show warnings;
-Level Code Message
-SELECT * from d1.res_t41;
-a b
-abcde a!@#$%^&*(
-SELECT * from res_t42;
-a b
-abcde a!@#$%^&*(
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE d2;
-
-Testcase 4.4.4:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-CREATE PROCEDURE sp3()
-BEGIN
-USE d1;
-END//
-ERROR 0A000: USE is not allowed in stored procedures
-USE db_storedproc;
-DROP DATABASE d1;
-
-Testcase 4.4.5:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-create table t43(a char(5), b char(10));
-insert into t43 values('abcde', 'a!@#$%^&*(');
-CREATE PROCEDURE d1.sp4()
-SELECT * from d1.t43;
-SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43
-USE db_storedproc;
-DROP DATABASE d1;
-CREATE DATABASE d1;
-USE d1;
-create table t44(a char(5), b char(10));
-SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-USE db_storedproc;
-DROP DATABASE d1;
-
-Testcase 4.4.6:
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5()
-SELECT * from db_storedproc.t4 limit 0, 10;
-SELECT db from mysql.proc where specific_name = 'sp5';
-db
-db_storedproc
-DROP PROCEDURE sp5;
-
-Testcase 4.4.7:
---------------------------------------------------------------------------------
-USE db_storedproc;
-drop table IF EXISTS t46;
-DROP PROCEDURE IF EXISTS sp6;
-create table t46(f1 char(20), f2 char(20));
-insert into t46 values ('abcd', 'wxyz');
-CREATE PROCEDURE db_storedproc.sp6()
-SELECT * from db_storedproc.t4 limit 0, 10;
-SELECT db from mysql.proc where specific_name = 'sp6';
-db
-db_storedproc
-drop table t46;
-DROP PROCEDURE sp6;
-
-Testcase 4.4.8:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-DROP DATABASE IF EXISTS d2;
-CREATE DATABASE d1;
-CREATE DATABASE d2;
-USE d1;
-CREATE PROCEDURE sp8 ( n char(20) ) sql security definer comment 'initial'
- SELECT * from t1 where t1.f1 = n;
-USE d2;
-alter procedure d1.sp8 sql security definer comment 'updated';
-SELECT * from mysql.proc where specific_name='sp8' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created NO_ENGINE_SUBSTITUTION updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
-
-Testcase 4.4.9:
---------------------------------------------------------------------------------
-USE d1;
-DROP FUNCTION IF EXISTS fn1;
-DROP FUNCTION IF EXISTS fn11;
-CREATE FUNCTION d1.fn2(n int) returns int sql security invoker comment 'initial'
-BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END//
-USE d2;
-alter function d1.fn2 sql security definer comment 'updated';
-SELECT * from mysql.proc where specific_name='fn2' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 fn2 FUNCTION fn2 SQL CONTAINS_SQL NO DEFINER n int int(11) BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END root@localhost modified created NO_ENGINE_SUBSTITUTION updated latin1 latin1_swedish_ci latin1_swedish_ci BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END
-
-Testcase 4.4.10:
---------------------------------------------------------------------------------
-USE d1;
-CREATE PROCEDURE sp9 ( n char(20) )
-SELECT * from t1 where t1.f1 = n;
-USE d2;
-DROP PROCEDURE d1.sp9;
-SELECT * from mysql.proc where specific_name='sp9' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.4.11:
---------------------------------------------------------------------------------
-USE d1;
-CREATE FUNCTION d1.fn3(n int) returns int
-BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END//
-USE d2;
-DROP FUNCTION d1.fn3;
-SELECT * from mysql.proc where specific_name='fn3' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE d2;
-
-Section 3.1.5 - Parameter use checks:
-Functions with all data types
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 bigint) returns bigint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn1(-9.22e+18);
-fn1(-9.22e+18)
--9220000000000000000
-DROP FUNCTION IF EXISTS fn2;
-CREATE FUNCTION fn2( f1 bigint unsigned) returns bigint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn2(1.84e+19);
-fn2(1.84e+19)
-18400000000000000000
-DROP FUNCTION IF EXISTS fn3;
-CREATE FUNCTION fn3( f1 bigint unsigned zerofill) returns bigint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn3(1.84e+17);
-fn3(1.84e+17)
-184000000000000000
-DROP FUNCTION IF EXISTS fn4;
-CREATE FUNCTION fn4( f1 bigint zerofill) returns bigint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn4(-9.22e+15);
-fn4(-9.22e+15)
-0
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn5;
-CREATE FUNCTION fn5( f1 decimal) returns decimal
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn5(-1.00e+09);
-fn5(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn6;
-CREATE FUNCTION fn6( f1 decimal (0)) returns decimal (0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn6(-1.00e+09);
-fn6(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn7;
-CREATE FUNCTION fn7( f1 decimal (0) unsigned) returns decimal (0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn7(99999999999);
-fn7(99999999999)
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn8;
-CREATE FUNCTION fn8( f1 decimal (0) unsigned zerofill) returns decimal (0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn8(999999999);
-fn8(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn9;
-CREATE FUNCTION fn9( f1 decimal (0) zerofill) returns decimal (0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn9(-1.00e+09);
-fn9(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn10;
-CREATE FUNCTION fn10( f1 decimal (0, 0)) returns decimal (0, 0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn10(-1.00e+09);
-fn10(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn11;
-CREATE FUNCTION fn11( f1 decimal (0, 0) unsigned) returns decimal (0, 0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn11(99999999999);
-fn11(99999999999)
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn12;
-CREATE FUNCTION fn12( f1 decimal (0, 0) unsigned zerofill) returns decimal (0, 0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn12(999999999);
-fn12(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn13;
-CREATE FUNCTION fn13( f1 decimal (0, 0) zerofill) returns decimal (0, 0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn13(-1.00e+09);
-fn13(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn14;
-CREATE FUNCTION fn14( f1 decimal (63, 30)) returns decimal (63, 30)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn14(-1.00e+21);
-fn14(-1.00e+21)
--1000000000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn15;
-CREATE FUNCTION fn15( f1 decimal (63, 30) unsigned) returns decimal (63, 30) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn15(1.00e+16);
-fn15(1.00e+16)
-10000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn16;
-CREATE FUNCTION fn16( f1 decimal (63, 30) unsigned zerofill) returns decimal (63, 30) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn16(1.00e+16);
-fn16(1.00e+16)
-000000000000000010000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn17;
-CREATE FUNCTION fn17( f1 decimal (63, 30) zerofill) returns decimal (63, 30) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn17(-1.00e+21);
-fn17(-1.00e+21)
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn18_d;
-CREATE FUNCTION fn18_d( f1 decimal (64)) returns decimal (64)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn18_d( -1000000000000000000000000000000 );
-fn18_d( -1000000000000000000000000000000 )
--1000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn19_du;
-CREATE FUNCTION fn19_du( f1 decimal (64) unsigned) returns decimal (64) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn19_du( 100000000000000000000 );
-fn19_du( 100000000000000000000 )
-100000000000000000000
-DROP FUNCTION IF EXISTS fn20_duz;
-CREATE FUNCTION fn20_duz( f1 decimal (64) unsigned zerofill) returns decimal (64) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn20_duz( 1000000000000000000000000 );
-fn20_duz( 1000000000000000000000000 )
-0000000000000000000000000000000000000001000000000000000000000000
-DROP FUNCTION IF EXISTS fn21_d_z;
-CREATE FUNCTION fn21_d_z( f1 decimal (64) zerofill) returns decimal (64) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn21_d_z(1.00e+00);
-fn21_d_z(1.00e+00)
-0000000000000000000000000000000000000000000000000000000000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn22;
-CREATE FUNCTION fn22( f1 decimal unsigned) returns decimal unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn22(1.00e+00);
-fn22(1.00e+00)
-10
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn23;
-CREATE FUNCTION fn23( f1 decimal unsigned zerofill) returns decimal unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn23(1.00e+00);
-fn23(1.00e+00)
-0000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn24;
-CREATE FUNCTION fn24( f1 decimal zerofill) returns decimal zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn24(-1.00e+09);
-fn24(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn25;
-CREATE FUNCTION fn25( f1 double) returns double
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn25(1.00e+00);
-fn25(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn26;
-CREATE FUNCTION fn26( f1 double unsigned) returns double unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn26(1.00e+00);
-fn26(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn27;
-CREATE FUNCTION fn27( f1 double unsigned zerofill) returns double unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn27(1.00e+00);
-fn27(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn28;
-CREATE FUNCTION fn28( f1 double zerofill) returns double zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn28(1.00e+00);
-fn28(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn29;
-CREATE FUNCTION fn29( f1 float) returns float
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn29(1.00e+00);
-fn29(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn30;
-CREATE FUNCTION fn30( f1 float unsigned) returns float unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn30(1.00e+00);
-fn30(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn31;
-CREATE FUNCTION fn31( f1 float unsigned zerofill) returns float unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn31(1.00e+00);
-fn31(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn32;
-CREATE FUNCTION fn32( f1 float zerofill) returns float zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn32(1.00e+00);
-fn32(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn33;
-CREATE FUNCTION fn33( f1 float(0)) returns float(0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn33(1.00e+00);
-fn33(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn34;
-CREATE FUNCTION fn34( f1 float(0) unsigned) returns float(0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn34(1.00e+00);
-fn34(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn35;
-CREATE FUNCTION fn35( f1 float(0) unsigned zerofill) returns float(0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn35(1.00e+00);
-fn35(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn36;
-CREATE FUNCTION fn36( f1 float(0) zerofill) returns float(0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn36(1.00e+00);
-fn36(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn37;
-CREATE FUNCTION fn37( f1 float(23)) returns float(23)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn37(1.00e+00);
-fn37(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn38;
-CREATE FUNCTION fn38( f1 float(23) unsigned) returns float(23) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn38(1.00e+00);
-fn38(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn39;
-CREATE FUNCTION fn39( f1 float(23) unsigned zerofill) returns float(23) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn39(1.00e+00);
-fn39(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn40;
-CREATE FUNCTION fn40( f1 float(23) zerofill) returns float(23) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn40(1.00e+00);
-fn40(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn41;
-CREATE FUNCTION fn41( f1 float(24)) returns float(24)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn41(1.00e+00);
-fn41(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn42;
-CREATE FUNCTION fn42( f1 float(24) unsigned) returns float(24) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn42(1.00e+00);
-fn42(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn43;
-CREATE FUNCTION fn43( f1 float(24) unsigned zerofill) returns float(24) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn43(1.00e+00);
-fn43(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn44;
-CREATE FUNCTION fn44( f1 float(24) zerofill) returns float(24) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn44(1.00e+00);
-fn44(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn45;
-CREATE FUNCTION fn45( f1 float(53)) returns float(53)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn45(1.00e+00);
-fn45(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn46;
-CREATE FUNCTION fn46( f1 float(53) unsigned) returns float(53) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn46(1.00e+00);
-fn46(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn47;
-CREATE FUNCTION fn47( f1 float(53) unsigned zerofill) returns float(53) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn47(1.00e+00);
-fn47(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn48;
-CREATE FUNCTION fn48( f1 float(53) zerofill) returns float(53) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn48(1.00e+00);
-fn48(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn49;
-CREATE FUNCTION fn49( f1 int) returns int
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn49(-2.15e+09);
-fn49(-2.15e+09)
--2147483638
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn50;
-CREATE FUNCTION fn50( f1 int unsigned) returns int unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn50(4.29e+09);
-fn50(4.29e+09)
-4290000000
-DROP FUNCTION IF EXISTS fn51;
-CREATE FUNCTION fn51( f1 int unsigned zerofill) returns int unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn51(4.29e+09);
-fn51(4.29e+09)
-4290000000
-DROP FUNCTION IF EXISTS fn52;
-CREATE FUNCTION fn52( f1 int zerofill) returns int zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn52(2.15e+08);
-fn52(2.15e+08)
-215000000
-DROP FUNCTION IF EXISTS fn53;
-CREATE FUNCTION fn53( f1 mediumint) returns mediumint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn53(-8388600);
-fn53(-8388600)
--8388598
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn54;
-CREATE FUNCTION fn54( f1 mediumint unsigned) returns mediumint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn54(16777201);
-fn54(16777201)
-16777202
-DROP FUNCTION IF EXISTS fn55;
-CREATE FUNCTION fn55( f1 mediumint unsigned zerofill) returns mediumint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn55(16777210);
-fn55(16777210)
-16777210
-DROP FUNCTION IF EXISTS fn56;
-CREATE FUNCTION fn56( f1 mediumint zerofill) returns mediumint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn56(-8388601);
-fn56(-8388601)
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn57;
-CREATE FUNCTION fn57( f1 numeric) returns numeric
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn57(-999999999);
-fn57(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn58;
-CREATE FUNCTION fn58( f1 numeric (0)) returns numeric (0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn58(-999999999);
-fn58(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn59;
-CREATE FUNCTION fn59( f1 numeric (0) unsigned) returns numeric (0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn59(9999999999);
-fn59(9999999999)
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn60;
-CREATE FUNCTION fn60( f1 numeric (0) unsigned zerofill) returns numeric (0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn60(99999999);
-fn60(99999999)
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn61;
-CREATE FUNCTION fn61( f1 numeric (0) zerofill) returns numeric (0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn61(-99999999);
-fn61(-99999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn62;
-CREATE FUNCTION fn62( f1 numeric (0, 0)) returns numeric (0, 0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn62(-999999999);
-fn62(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn63;
-CREATE FUNCTION fn63( f1 numeric (0, 0) unsigned) returns numeric (0, 0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn63(9999999999);
-fn63(9999999999)
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn64;
-CREATE FUNCTION fn64( f1 numeric (0, 0) unsigned zerofill) returns numeric (0, 0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn64(99999999);
-fn64(99999999)
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn65;
-CREATE FUNCTION fn65( f1 numeric (0, 0) zerofill) returns numeric (0, 0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn65(-99999999);
-fn65(-99999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn66;
-CREATE FUNCTION fn66( f1 numeric (63, 30)) returns numeric (63, 30)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn66(-1e+36);
-fn66(-1e+36)
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn67;
-CREATE FUNCTION fn67( f1 numeric (63, 30) unsigned) returns numeric (63, 30) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn67(1e+36);
-fn67(1e+36)
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn68;
-CREATE FUNCTION fn68( f1 numeric (63, 30) unsigned zerofill) returns numeric (63, 30) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn68(1e+36);
-fn68(1e+36)
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn69;
-CREATE FUNCTION fn69( f1 numeric (63, 30) zerofill) returns numeric (63, 30) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn69(-1e+36);
-fn69(-1e+36)
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn70_n;
-CREATE FUNCTION fn70_n( f1 numeric (64)) returns numeric (64)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn70_n( -1000000000000000000000000000000 );
-fn70_n( -1000000000000000000000000000000 )
--1000000000000000000000000000000
-SELECT fn70_n( -10000000000000000000000000000000000000000 );
-fn70_n( -10000000000000000000000000000000000000000 )
--10000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn71_nu;
-CREATE FUNCTION fn71_nu( f1 numeric (64) unsigned) returns numeric (64) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn71_nu( 10000000000000000000000000000000000000000 );
-fn71_nu( 10000000000000000000000000000000000000000 )
-10000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn72_nuz;
-CREATE FUNCTION fn72_nuz( f1 numeric (64) unsigned zerofill) returns numeric (64) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn72_nuz( 10000000000000000000000000000000000000000 );
-fn72_nuz( 10000000000000000000000000000000000000000 )
-0000000000000000000000010000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn73_n_z;
-CREATE FUNCTION fn73_n_z( f1 numeric (64) zerofill) returns numeric (64) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn73_n_z( 10000000000000000000000000000000000000000 );
-fn73_n_z( 10000000000000000000000000000000000000000 )
-0000000000000000000000010000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn74;
-CREATE FUNCTION fn74( f1 numeric unsigned) returns numeric unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn74(999999999);
-fn74(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn75;
-CREATE FUNCTION fn75( f1 numeric unsigned zerofill) returns numeric unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn75(999999999);
-fn75(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn76;
-CREATE FUNCTION fn76( f1 numeric zerofill) returns numeric zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn76(-999999999);
-fn76(-999999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn77;
-CREATE FUNCTION fn77( f1 real) returns real
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn77(1.1);
-fn77(1.1)
-1.1
-DROP FUNCTION IF EXISTS fn78;
-CREATE FUNCTION fn78( f1 real unsigned) returns real unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn78(1.1);
-fn78(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn79;
-CREATE FUNCTION fn79( f1 real unsigned zerofill) returns real unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn79(1.1);
-fn79(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn80;
-CREATE FUNCTION fn80( f1 real zerofill) returns real zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn80(1.1);
-fn80(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn81;
-CREATE FUNCTION fn81( f1 smallint) returns smallint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn81(-32701);
-fn81(-32701)
--32702
-DROP FUNCTION IF EXISTS fn82;
-CREATE FUNCTION fn82( f1 smallint unsigned) returns smallint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn82(65531);
-fn82(65531)
-65532
-DROP FUNCTION IF EXISTS fn83;
-CREATE FUNCTION fn83( f1 smallint unsigned zerofill) returns smallint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn83(65531);
-fn83(65531)
-65532
-DROP FUNCTION IF EXISTS fn84;
-CREATE FUNCTION fn84( f1 smallint zerofill) returns smallint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn84(-32601);
-fn84(-32601)
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn85;
-CREATE FUNCTION fn85( f1 tinyint) returns tinyint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn85(-115);
-fn85(-115)
--116
-DROP FUNCTION IF EXISTS fn86;
-CREATE FUNCTION fn86( f1 tinyint unsigned) returns tinyint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn86(251);
-fn86(251)
-252
-DROP FUNCTION IF EXISTS fn87;
-CREATE FUNCTION fn87( f1 tinyint unsigned zerofill) returns tinyint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn87(201);
-fn87(201)
-202
-DROP FUNCTION IF EXISTS fn88;
-CREATE FUNCTION fn88( f1 tinyint zerofill) returns tinyint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn88(-101);
-fn88(-101)
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn89;
-CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
-BEGIN
-IF f1 = '1enum' THEN
-SET f1 = '2enum';
-ELSE
-SET f1 = '1enum';
-END IF;
-RETURN f1;
-END//
-SELECT fn89( '1enum');
-fn89( '1enum')
-2enum
-DROP FUNCTION IF EXISTS fn90;
-CREATE FUNCTION fn90( f1 set('1set', '2set')) returns set('1set', '2set')
-BEGIN
-IF f1 = '1set' THEN
-SET f1 = '2set';
-ELSE
-SET f1 = '1set';
-END IF;
-RETURN f1;
-END//
-SELECT fn90( '1set');
-fn90( '1set')
-2set
-DROP FUNCTION IF EXISTS fn91;
-CREATE FUNCTION fn91( f1 date) returns date
-BEGIN
-set f1 = adddate(f1, interval 31 day);
-return f1;
-END//
-SELECT fn91('1997-12-31');
-fn91('1997-12-31')
-1998-01-31
-DROP FUNCTION IF EXISTS fn92;
-CREATE FUNCTION fn92( f1 time) returns time
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998');
-return f1;
-END//
-SELECT fn92( '23:59:59.999999');
-fn92( '23:59:59.999999')
-25:59:59
-DROP FUNCTION IF EXISTS fn93;
-CREATE FUNCTION fn93( f1 datetime) returns datetime
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002');
-return f1;
-END//
-SELECT fn93('1997-12-31 23:59:59.999999');
-fn93('1997-12-31 23:59:59.999999')
-1998-01-02 01:01:00
-DROP FUNCTION IF EXISTS fn94;
-CREATE FUNCTION fn94( f1 char) returns char
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn94( 'h');
-fn94( 'h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn95;
-CREATE FUNCTION fn95( f1 char ascii) returns char ascii
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn95('h');
-fn95('h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn96;
-CREATE FUNCTION fn96( f1 binary) returns binary(2)
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn96( 'h');
-fn96( 'h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn97;
-CREATE FUNCTION fn97( f1 longtext) returns longtext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn97( 'world');
-fn97( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn98;
-CREATE FUNCTION fn98( f1 mediumtext) returns mediumtext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn98( 'world');
-fn98( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn99;
-CREATE FUNCTION fn99( f1 text) returns text
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn99( 'world');
-fn99( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn100;
-CREATE FUNCTION fn100( f1 tinytext) returns tinytext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn100( 'world');
-fn100( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn101;
-CREATE FUNCTION fn101( f1 year) returns year
-BEGIN
-set f1 = f1 + 10;
-return f1;
-END//
-SELECT fn101(51);
-fn101(51)
-2061
-DROP FUNCTION IF EXISTS fn102;
-CREATE FUNCTION fn102( f1 year(4)) returns year(4)
-BEGIN
-set f1 = f1 + 51;
-return f1;
-END//
-SELECT fn102(1982);
-fn102(1982)
-2033
-DROP FUNCTION IF EXISTS fn103;
-CREATE FUNCTION fn103( f1 geometrycollection) returns geometrycollection
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\
-
-DROP FUNCTION IF EXISTS fn104;
-CREATE FUNCTION fn104( f1 linestring) returns linestring
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@')
-
-DROP FUNCTION IF EXISTS fn105;
-CREATE FUNCTION fn105( f1 point) returns point
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@');
-fn105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@')
-
-DROP FUNCTION IF EXISTS fn106;
-CREATE FUNCTION fn106( f1 polygon) returns polygon
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\
-
-DROP FUNCTION IF EXISTS fn107;
-CREATE FUNCTION fn107( f1 timestamp) returns timestamp
-BEGIN
-set f1 = now();
-return f1;
-END//
-SELECT fn107(20050510080451);
-fn107(20050510080451)
-returned
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-USE db1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp1(-9.22e+18);
-f1
--9220000000000000000
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( f1 bigint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp2(1.84e+19);
-f1
-18400000000000000000
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( f1 bigint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp3(1.84e+17);
-f1
-00184000000000000000
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4( f1 bigint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp4(-9.22e+15);
-f1
-00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5( f1 decimal)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp5(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( f1 decimal (0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp6(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7( f1 decimal (0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp7(99999999999);
-f1
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp8(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp9;
-CREATE PROCEDURE sp9( f1 decimal (0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp9(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp10;
-CREATE PROCEDURE sp10( f1 decimal (0, 0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp10(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp11;
-CREATE PROCEDURE sp11( f1 decimal (0, 0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp11(99999999999);
-f1
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp12;
-CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp12(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp13;
-CREATE PROCEDURE sp13( f1 decimal (0, 0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp13(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp14;
-CREATE PROCEDURE sp14( f1 decimal (63, 30))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp14(-1.00e+21);
-f1
--1000000000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp15;
-CREATE PROCEDURE sp15( f1 decimal (63, 30) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp15(1.00e+16);
-f1
-10000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( f1 decimal (63, 30) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp16(1.00e+16);
-f1
-000000000000000010000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp17;
-CREATE PROCEDURE sp17( f1 decimal (63, 30) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp17(-1.00e+21);
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp18_d;
-CREATE PROCEDURE sp18_d( f1 decimal (64))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp18_d(-1.00e+30);
-f1
--1000000000000000000000000000000
-CALL sp18_d( -1000000000000000000000000000000 );
-f1
--1000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp19_du;
-CREATE PROCEDURE sp19_du( f1 decimal (64) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp19_du(1.00e+20);
-f1
-100000000000000000000
-CALL sp19_du( 100000000000000000000 );
-f1
-100000000000000000000
-CALL sp19_du(1.00e+24);
-f1
-1000000000000000000000000
-CALL sp19_du( 1000000000000000000000000 );
-f1
-1000000000000000000000000
-DROP PROCEDURE IF EXISTS sp20_duz;
-CREATE PROCEDURE sp20_duz( f1 decimal (64) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp20_duz(1.00e+20);
-f1
-0000000000000000000000000000000000000000000100000000000000000000
-CALL sp20_duz( 100000000000000000000 );
-f1
-0000000000000000000000000000000000000000000100000000000000000000
-CALL sp20_duz(1.00e+24);
-f1
-0000000000000000000000000000000000000001000000000000000000000000
-CALL sp20_duz( 1000000000000000000000000 );
-f1
-0000000000000000000000000000000000000001000000000000000000000000
-DROP PROCEDURE IF EXISTS sp21;
-CREATE PROCEDURE sp21( f1 decimal (64) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp21(1.00e+00);
-f1
-0000000000000000000000000000000000000000000000000000000000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( f1 decimal unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp22(1.00e+00);
-f1
-10
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp23(1.00e+00);
-f1
-0000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp24;
-CREATE PROCEDURE sp24( f1 decimal zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp24(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( f1 double)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp25(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp26;
-CREATE PROCEDURE sp26( f1 double unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp26(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp27;
-CREATE PROCEDURE sp27( f1 double unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp27(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp28;
-CREATE PROCEDURE sp28( f1 double zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp28(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp29;
-CREATE PROCEDURE sp29( f1 float)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp29(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp30;
-CREATE PROCEDURE sp30( f1 float unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp30(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp31;
-CREATE PROCEDURE sp31( f1 float unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp31(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp32;
-CREATE PROCEDURE sp32( f1 float zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp32(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp33;
-CREATE PROCEDURE sp33( f1 float(0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp33(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp34;
-CREATE PROCEDURE sp34( f1 float(0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp34(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp35;
-CREATE PROCEDURE sp35( f1 float(0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp35(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp36;
-CREATE PROCEDURE sp36( f1 float(0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp36(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp37;
-CREATE PROCEDURE sp37( f1 float(23))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp37(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp38;
-CREATE PROCEDURE sp38( f1 float(23) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp38(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp39;
-CREATE PROCEDURE sp39( f1 float(23) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp39(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp40;
-CREATE PROCEDURE sp40( f1 float(23) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp40(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp41;
-CREATE PROCEDURE sp41( f1 float(24))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp41(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp42;
-CREATE PROCEDURE sp42( f1 float(24) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp42(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp43;
-CREATE PROCEDURE sp43( f1 float(24) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp43(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp44;
-CREATE PROCEDURE sp44( f1 float(24) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp44(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp45;
-CREATE PROCEDURE sp45( f1 float(53))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp45(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp46;
-CREATE PROCEDURE sp46( f1 float(53) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp46(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp47;
-CREATE PROCEDURE sp47( f1 float(53) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp47(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp48;
-CREATE PROCEDURE sp48( f1 float(53) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp48(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp49;
-CREATE PROCEDURE sp49( f1 int)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp49(-2.15e+09);
-f1
--2147483638
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp50;
-CREATE PROCEDURE sp50( f1 int unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp50(4.29e+09);
-f1
-4290000000
-DROP PROCEDURE IF EXISTS sp51;
-CREATE PROCEDURE sp51( f1 int unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp51(4.29e+09);
-f1
-4290000000
-DROP PROCEDURE IF EXISTS sp52;
-CREATE PROCEDURE sp52( f1 int zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp52(2.15e+08);
-f1
-0215000000
-DROP PROCEDURE IF EXISTS sp53;
-CREATE PROCEDURE sp53( f1 mediumint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp53(-8388600);
-f1
--8388598
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp54;
-CREATE PROCEDURE sp54( f1 mediumint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp54(16777201);
-f1
-16777202
-DROP PROCEDURE IF EXISTS sp55;
-CREATE PROCEDURE sp55( f1 mediumint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp55(16777210);
-f1
-16777210
-DROP PROCEDURE IF EXISTS sp56;
-CREATE PROCEDURE sp56( f1 mediumint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp56(-8388601);
-f1
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp57;
-CREATE PROCEDURE sp57( f1 numeric)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp57(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp58;
-CREATE PROCEDURE sp58( f1 numeric (0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp58(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp59;
-CREATE PROCEDURE sp59( f1 numeric (0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp59(9999999999);
-f1
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp60;
-CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp60(99999999);
-f1
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp61;
-CREATE PROCEDURE sp61( f1 numeric (0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp61(-99999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp62;
-CREATE PROCEDURE sp62( f1 numeric (0, 0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp62(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp63;
-CREATE PROCEDURE sp63( f1 numeric (0, 0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp63(9999999999);
-f1
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp64;
-CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp64(99999999);
-f1
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp65;
-CREATE PROCEDURE sp65( f1 numeric (0, 0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp65(-99999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp66_n;
-CREATE PROCEDURE sp66_n( f1 numeric (63, 30))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp66_n(-1e+36);
-f1
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp66_n( -1000000000000000000000000000000000000 );
-f1
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp67_nu;
-CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp67_nu(1e+36);
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp67_nu( 1000000000000000000000000000000000000 );
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp68_nuz;
-CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp68_nuz(1e+36);
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp68_nuz( 1000000000000000000000000000000000000 );
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp69_n_z;
-CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp69_n_z(-1e+36);
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp69_n_z( -1000000000000000000000000000000000000 );
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp70_n;
-CREATE PROCEDURE sp70_n( f1 numeric (64))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp70_n(-1e+40);
-f1
--10000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp70_n( -10000000000000000000000000000000000000000 );
-f1
--10000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp71_nu;
-CREATE PROCEDURE sp71_nu( f1 numeric (64) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp71_nu(1.00e+40);
-f1
-10000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp71_nu( 10000000000000000000000000000000000000000 );
-f1
-10000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp72_nuz;
-CREATE PROCEDURE sp72_nuz( f1 numeric (64) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp72_nuz(1.00e+40);
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp72_nuz( 10000000000000000000000000000000000000000 );
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp73_n_z;
-CREATE PROCEDURE sp73_n_z( f1 numeric (64) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp73_n_z(1.00e+40);
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp73_n_z( 10000000000000000000000000000000000000000 );
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp74;
-CREATE PROCEDURE sp74( f1 numeric unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp74(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp75;
-CREATE PROCEDURE sp75( f1 numeric unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp75(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp76;
-CREATE PROCEDURE sp76( f1 numeric zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp76(-999999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp77;
-CREATE PROCEDURE sp77( f1 real)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp77(1.1);
-f1
-1.1
-DROP PROCEDURE IF EXISTS sp78;
-CREATE PROCEDURE sp78( f1 real unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp78(1.1);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp79;
-CREATE PROCEDURE sp79( f1 real unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp79(1.1);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp80;
-CREATE PROCEDURE sp80( f1 real zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp80(1.1);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp81;
-CREATE PROCEDURE sp81( f1 smallint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp81(-32701);
-f1
--32702
-DROP PROCEDURE IF EXISTS sp82;
-CREATE PROCEDURE sp82( f1 smallint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp82(65531);
-f1
-65532
-DROP PROCEDURE IF EXISTS sp83;
-CREATE PROCEDURE sp83( f1 smallint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp83(65531);
-f1
-65532
-DROP PROCEDURE IF EXISTS sp84;
-CREATE PROCEDURE sp84( f1 smallint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp84(-32601);
-f1
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp85;
-CREATE PROCEDURE sp85( f1 tinyint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp85(-115);
-f1
--116
-DROP PROCEDURE IF EXISTS sp86;
-CREATE PROCEDURE sp86( f1 tinyint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp86(251);
-f1
-252
-DROP PROCEDURE IF EXISTS sp87;
-CREATE PROCEDURE sp87( f1 tinyint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp87(201);
-f1
-202
-DROP PROCEDURE IF EXISTS sp88;
-CREATE PROCEDURE sp88( f1 tinyint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp88(-101);
-f1
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp89;
-CREATE PROCEDURE sp89( f1 enum('1enum', '2enum'))
-BEGIN
-IF f1 = '1enum' THEN set f1 = '2enum'; ELSE set f1 = '1enum'; END IF;
-END//
-CALL sp89( '1enum');
-DROP PROCEDURE IF EXISTS sp90;
-CREATE PROCEDURE sp90( f1 set('1set', '2set'))
-BEGIN
-IF f1 = '1set' THEN set f1 = '2set'; ELSE set f1 = '1set'; END IF;
-END//
-CALL sp90( '1set');
-DROP PROCEDURE IF EXISTS sp91;
-CREATE PROCEDURE sp91( f1 date)
-BEGIN
-set f1 = adddate(f1, interval 31 day);
-SELECT f1;
-END//
-CALL sp91( '1997-12-31');
-f1
-1998-01-31
-DROP PROCEDURE IF EXISTS sp92;
-CREATE PROCEDURE sp92( f1 time)
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998');
-SELECT f1;
-END//
-CALL sp92( '23:59:59.999999');
-f1
-25:59:59
-DROP PROCEDURE IF EXISTS sp93;
-CREATE PROCEDURE sp93( f1 datetime)
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002');
-SELECT f1;
-END//
-CALL sp93('1997-12-31 23:59:59.999999');
-f1
-1998-01-02 01:01:00
-DROP PROCEDURE IF EXISTS sp94;
-CREATE PROCEDURE sp94( f1 char)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp94( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp95;
-CREATE PROCEDURE sp95( f1 char ascii)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp95( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp96;
-CREATE PROCEDURE sp96( f1 char binary)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp96( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp97;
-CREATE PROCEDURE sp97( f1 longtext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp97( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp98;
-CREATE PROCEDURE sp98( f1 mediumtext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp98( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp99;
-CREATE PROCEDURE sp99( f1 text)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp99( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp100;
-CREATE PROCEDURE sp100( f1 tinytext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp100( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp101;
-CREATE PROCEDURE sp101( f1 year)
-BEGIN
-set f1 = f1 + 10;
-SELECT f1;
-END//
-CALL sp101(51);
-f1
-2061
-DROP PROCEDURE IF EXISTS sp102;
-CREATE PROCEDURE sp102( f1 year(4))
-BEGIN
-set f1 = f1 + 51;
-SELECT f1;
-END//
-CALL sp102(1982);
-f1
-2033
-DROP PROCEDURE IF EXISTS sp103;
-CREATE PROCEDURE sp103( f1 geometrycollection)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp104;
-CREATE PROCEDURE sp104( f1 linestring)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp105;
-CREATE PROCEDURE sp105( f1 point)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@');
-f1
-
-DROP PROCEDURE IF EXISTS sp106;
-CREATE PROCEDURE sp106( f1 polygon)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp107;
-CREATE PROCEDURE sp107( f1 timestamp)
-BEGIN
-set f1 = now() + 0 + f1;
-SELECT f1;
-END//
-CALL sp107(2.00e+13);
-f1
-returned
-Warnings:
-returned 1265 Data truncated for column 'f1' at row 1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-USE db1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( in f1 year, inout f2 year, out f3 year, in f4 year,
-inout f5 year, out f6 year, in f7 year(4), inout f8 year(4),
-out f9 year(4), in f10 year(4), inout f11 year(4), out f12 year(4))
-BEGIN
-set f1 = f1 + 10; set f2 = f2 + 10; set f3 = f2 + 10;
-set f4 = f4 + 10; set f5 = f5 + 10; set f6 = f5 + 10;
-set f7 = f7 + 51; set f8 = f8 + 51; set f9 = f8 + 51;
-set f10 = f10 + 51; set f11 = f11 + 51; set f12 = f11 + 51;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute01;
-CREATE PROCEDURE spexecute01()
-BEGIN
-declare var1 year;
-declare var2 year;
-declare var3 year;
-declare var4 year;
-declare var5 year(4);
-declare var6 year(4);
-declare var7 year(4);
-declare var8 year(4);
-set var1 = 51;
-set var3 = 51;
-set var5 = 1982;
-set var7 = 1982;
-CALL sp1(51, var1, var2, 51, var3, var4, 1982, var5, var6, 1982, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute01();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2061 2061 2071 2061 2061 2071 2033 2033 2084 2033 2033 2084
-var1 var2 var3 var4 var5 var6 var7 var8
-2061 2071 2061 2071 2033 2084 2033 2084
-DROP PROCEDURE spexecute01;
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( in f1 text, inout f2 text, out f3 text, in f4 text, inout f5 text,
-out f6 text, in f7 tinytext, inout f8 tinytext, out f9 tinytext,
-in f10 tinytext, inout f11 tinytext, out f12 tinytext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute02;
-CREATE PROCEDURE spexecute02()
-BEGIN
-declare var1 text;
-declare var2 text;
-declare var3 text;
-declare var4 text;
-declare var5 tinytext;
-declare var6 tinytext;
-declare var7 tinytext;
-declare var8 tinytext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp2( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute02();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute02;
-DROP PROCEDURE sp2;
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( in f1 char, inout f2 char, out f3 char, in f4 char ascii,
-inout f5 char ascii, out f6 char ascii, in f7 longtext,
-inout f8 longtext, out f9 longtext, in f10 mediumtext,
-inout f11 mediumtext, out f12 mediumtext)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f1);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f4);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f9);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute03;
-CREATE PROCEDURE spexecute03()
-BEGIN
-declare var1 char;
-declare var2 char;
-declare var3 char ascii;
-declare var4 char ascii;
-declare var5 longtext;
-declare var6 longtext;
-declare var7 mediumtext;
-declare var8 mediumtext;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp3( 'h', var1, var2, 'h', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute03();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a helloworld helloworld NULL helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a helloworld NULL helloworld hellohelloworld
-DROP PROCEDURE spexecute03;
-DROP PROCEDURE sp3;
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4( in f1 bigint, inout f2 bigint, out f3 bigint,
-in f4 bigint, inout f5 bigint, out f6 bigint,
-in f7 bigint, inout f8 bigint, out f9 bigint,
-in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute04;
-CREATE PROCEDURE spexecute04()
-BEGIN
-declare var1 bigint;
-declare var2 bigint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -9.22e+18;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp4(-9.22e+18, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute04();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-6744073709551616 6744073709551616 -9220000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute04;
-DROP PROCEDURE sp4;
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( in f1 timestamp, inout f2 timestamp, out f3 timestamp, in f4 timestamp, inout f5 timestamp, out f6 timestamp, in f7 timestamp, inout f8 timestamp, out f9 timestamp, in f10 timestamp, inout f11 timestamp, out f12 timestamp)
-BEGIN
-set f1 = now() + 0 + f1; set f2 = now() + 0 + f2; set f3 = now() + 0 + f1;
-set f4 = now() + 0 + f4; set f5 = now() + 0 + f5; set f6 = now() + 0 + f5;
-set f7 = now() + 0 + f7; set f8 = now() + 0 + f8; set f9 = now() + 0 + f8;
-set f10 = now() + 0 + f10; set f11 = now() + 0 + f11; set f12 = now() + 0 + f11;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute06;
-CREATE PROCEDURE spexecute06()
-BEGIN
-declare var1 timestamp;
-declare var2 timestamp;
-declare var3 timestamp;
-declare var4 timestamp;
-declare var5 timestamp;
-declare var6 timestamp;
-declare var7 timestamp;
-declare var8 timestamp;
-set var1 = 2.00e+13;
-set var3 = 2.00e+13;
-set var5 = 2.00e+13;
-set var7 = 2.00e+13;
-CALL sp6(2.00e+13, var1, var2, 2.00e+13, var3, var4, 2.00e+13, var5, var6, 2.00e+13, var7, var8);
-END//
-CALL spexecute06();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-returned returned returned returned returned returned returned returned returned returned returned returned
-DROP PROCEDURE spexecute06;
-DROP PROCEDURE sp6;
-DROP PROCEDURE IF EXISTS sp07;
-CREATE PROCEDURE sp07( IN f1 BIGINT UNSIGNED,
-INOUT f2 BIGINT UNSIGNED,
-OUT f3 BIGINT UNSIGNED,
-IN f4 BIGINT,
-INOUT f5 BIGINT,
-OUT f6 BIGINT,
-IN f7 BIGINT,
-INOUT f8 BIGINT,
-OUT f9 BIGINT,
-IN f10 BIGINT,
-INOUT f11 BIGINT,
-OUT f12 BIGINT)
-BEGIN
-SELECT f1, f2, f3;
-SELECT f4, f5, f6;
-SELECT f7, f8, f9;
-SELECT f10, f11, f12;
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f3 * 2); set f3 = (f3 - 10); set f3 = (f3 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3;
-SELECT f4, f5, f6;
-SELECT f7, f8, f9;
-SELECT f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute07;
-CREATE PROCEDURE spexecute07()
-BEGIN
-declare var1 bigint unsigned;
-declare var2 bigint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.84e+19;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-SELECT var1, var2;
-SELECT var3, var4;
-SELECT var5, var6;
-SELECT var7, var8;
-CALL sp07( var1, var1, var2, var3, var3, var4,
-var5, var5, var6, var7, var7, var8 );
-SELECT var1, var2;
-SELECT var3, var4;
-SELECT var5, var6;
-SELECT var7, var8;
-END//
-CALL spexecute07();
-var1 var2
-18400000000000000000 NULL
-var3 var4
--9220000000000000000 NULL
-var5 var6
--9220000000000000000 NULL
-var7 var8
--9220000000000000000 NULL
-f1 f2 f3
-18400000000000000000 18400000000000000000 NULL
-f4 f5 f6
--9220000000000000000 -9220000000000000000 NULL
-f7 f8 f9
--9220000000000000000 -9220000000000000000 NULL
-f10 f11 f12
--9220000000000000000 -9220000000000000000 NULL
-f1 f2 f3
-18353255926290448384 18353255926290448384 18353255926290448384
-f4 f5 f6
--9220000000000000000 6744073709551616 6744073709551616
-f7 f8 f9
--9220000000000000000 6744073709551616 6744073709551616
-f10 f11 f12
--9220000000000000000 6744073709551616 6744073709551616
-var1 var2
-18353255926290448384 18353255926290448384
-var3 var4
-6744073709551616 6744073709551616
-var5 var6
-6744073709551616 6744073709551616
-var7 var8
-6744073709551616 6744073709551616
-DROP PROCEDURE spexecute07;
-DROP PROCEDURE sp07;
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8( in f1 bigint unsigned zerofill,
-inout f2 bigint unsigned zerofill,
-out f3 bigint unsigned zerofill,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute08;
-CREATE PROCEDURE spexecute08()
-BEGIN
-declare var1 bigint unsigned zerofill;
-declare var2 bigint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.84e+17;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp8(1.84e+17, var1, var2, -9.22e+18, var3, var4,
--9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute08();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00368000000000000000 00368000000000000000 00368000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00368000000000000000 00368000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute08;
-DROP PROCEDURE sp8;
-DROP PROCEDURE IF EXISTS sp9;
-CREATE PROCEDURE sp9( in f1 bigint zerofill,
-inout f2 bigint zerofill,
-out f3 bigint zerofill,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute09;
-CREATE PROCEDURE spexecute09()
-BEGIN
-declare var1 bigint zerofill;
-declare var2 bigint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -9.22e+15;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp9(-9.22e+15, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute09();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00000000000000000000 00000000000000000000 00000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00000000000000000000 00000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute09;
-DROP PROCEDURE sp9;
-DROP PROCEDURE IF EXISTS sp10;
-CREATE PROCEDURE sp10( in f1 decimal,
-inout f2 decimal,
-out f3 decimal,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute10;
-CREATE PROCEDURE spexecute10()
-BEGIN
-declare var1 decimal;
-declare var2 decimal;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp10(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute10();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute10;
-DROP PROCEDURE sp10;
-DROP PROCEDURE IF EXISTS sp11;
-CREATE PROCEDURE sp11( in f1 decimal (0), inout f2 decimal (0), out f3 decimal (0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute11;
-CREATE PROCEDURE spexecute11()
-BEGIN
-declare var1 decimal (0);
-declare var2 decimal (0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = --1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp11(--1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute11();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute11;
-DROP PROCEDURE sp11;
-DROP PROCEDURE IF EXISTS sp12;
-CREATE PROCEDURE sp12( in f1 decimal (0) unsigned, inout f2 decimal (0) unsigned, out f3 decimal (0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute12;
-CREATE PROCEDURE spexecute12()
-BEGIN
-declare var1 decimal (0) unsigned;
-declare var2 decimal (0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp12(99999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute12();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute12;
-DROP PROCEDURE sp12;
-DROP PROCEDURE IF EXISTS sp13;
-CREATE PROCEDURE sp13( in f1 decimal (0, 0) zerofill, inout f2 decimal (0, 0) zerofill, out f3 decimal (0, 0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute13;
-CREATE PROCEDURE spexecute13()
-BEGIN
-declare var1 decimal (0, 0) zerofill;
-declare var2 decimal (0, 0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp13(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute13();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute13;
-DROP PROCEDURE sp13;
-DROP PROCEDURE IF EXISTS sp14;
-CREATE PROCEDURE sp14( in f1 decimal (63, 30), inout f2 decimal (63, 30), out f3 decimal (63, 30), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute14;
-CREATE PROCEDURE spexecute14()
-BEGIN
-declare var1 decimal (63, 30);
-declare var2 decimal (63, 30);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+21;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp14(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute14();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000000000000000.000000000000000000000000000000 -1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute14;
-DROP PROCEDURE sp14;
-DROP PROCEDURE IF EXISTS sp15;
-CREATE PROCEDURE sp15( in f1 double, inout f2 double, out f3 double, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute15;
-CREATE PROCEDURE spexecute15()
-BEGIN
-declare var1 double;
-declare var2 double;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp15(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute15();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute15;
-DROP PROCEDURE sp15;
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( in f1 double zerofill, inout f2 double zerofill, out f3 double zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute16;
-CREATE PROCEDURE spexecute16()
-BEGIN
-declare var1 double zerofill;
-declare var2 double zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp16(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute16();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute16;
-DROP PROCEDURE sp16;
-DROP PROCEDURE IF EXISTS sp17;
-CREATE PROCEDURE sp17( in f1 double unsigned, inout f2 double unsigned, out f3 double unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute17;
-CREATE PROCEDURE spexecute17()
-BEGIN
-declare var1 double unsigned;
-declare var2 double unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp17(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute17();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute17;
-DROP PROCEDURE sp17;
-DROP PROCEDURE IF EXISTS sp18;
-CREATE PROCEDURE sp18( in f1 double unsigned zerofill, inout f2 double unsigned zerofill, out f3 double unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute18;
-CREATE PROCEDURE spexecute18()
-BEGIN
-declare var1 double unsigned zerofill;
-declare var2 double unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp18(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute18();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute18;
-DROP PROCEDURE sp18;
-DROP PROCEDURE IF EXISTS sp19;
-CREATE PROCEDURE sp19( in f1 float unsigned, inout f2 float unsigned, out f3 float unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute19;
-CREATE PROCEDURE spexecute19()
-BEGIN
-declare var1 float unsigned;
-declare var2 float unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp19(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute19();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute19;
-DROP PROCEDURE sp19;
-DROP PROCEDURE IF EXISTS sp20;
-CREATE PROCEDURE sp20( in f1 float unsigned zerofill, inout f2 float unsigned zerofill, out f3 float unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute20;
-CREATE PROCEDURE spexecute20()
-BEGIN
-declare var1 float unsigned zerofill;
-declare var2 float unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp20(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute20();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute20;
-DROP PROCEDURE sp20;
-DROP PROCEDURE IF EXISTS sp21;
-CREATE PROCEDURE sp21( in f1 float zerofill, inout f2 float zerofill, out f3 float zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute21;
-CREATE PROCEDURE spexecute21()
-BEGIN
-declare var1 float zerofill;
-declare var2 float zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp21(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute21();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute21;
-DROP PROCEDURE sp21;
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( in f1 float(0), inout f2 float(0), out f3 float(0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute22;
-CREATE PROCEDURE spexecute22()
-BEGIN
-declare var1 float(0);
-declare var2 float(0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp22(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute22();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute22;
-DROP PROCEDURE sp22;
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( in f1 numeric, inout f2 numeric, out f3 numeric, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute23;
-CREATE PROCEDURE spexecute23()
-BEGIN
-declare var1 numeric;
-declare var2 numeric;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp23(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute23();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute23;
-DROP PROCEDURE sp23;
-DROP PROCEDURE IF EXISTS sp24;
-CREATE PROCEDURE sp24( in f1 real, inout f2 real, out f3 real, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute24;
-CREATE PROCEDURE spexecute24()
-BEGIN
-declare var1 real;
-declare var2 real;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp24(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute24();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1.1 1.1 11.1 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1.1 11.1 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute24;
-DROP PROCEDURE sp24;
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( in f1 smallint, inout f2 smallint, out f3 smallint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute25;
-CREATE PROCEDURE spexecute25()
-BEGIN
-declare var1 smallint;
-declare var2 smallint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32701;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp25(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute25();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32758 -32758 -32748 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32758 -32748 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute25;
-DROP PROCEDURE sp25;
-DROP PROCEDURE IF EXISTS sp26;
-CREATE PROCEDURE sp26( in f1 date, inout f2 date, out f3 date, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = adddate(f1, interval 31 day); set f2 = adddate(f2, interval 31 day); set f3 = adddate(f2, interval 31 day);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute26;
-CREATE PROCEDURE spexecute26()
-BEGIN
-declare var1 date;
-declare var2 date;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '1997-12-31';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp26( '1997-12-31', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute26();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-31 1998-01-31 1998-03-03 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-31 1998-03-03 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute26;
-DROP PROCEDURE sp26;
-DROP PROCEDURE IF EXISTS sp27;
-CREATE PROCEDURE sp27( in f1 time, inout f2 time, out f3 time, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998'); set f2 = addtime(f2, '02:00:00.999998'); set f3 = addtime(f2, '02:00:00.999998');
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute27;
-CREATE PROCEDURE spexecute27()
-BEGIN
-declare var1 time;
-declare var2 time;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '23:59:59.999999';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp27( '23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute27();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-25:59:59 25:59:59 27:59:59 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-25:59:59 27:59:59 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute27;
-DROP PROCEDURE sp27;
-DROP PROCEDURE IF EXISTS sp28;
-CREATE PROCEDURE sp28( in f1 datetime, inout f2 datetime, out f3 datetime, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002'); set f2 = addtime(f2, '1 1:1:1.000002'); set f3 = addtime(f1, '1 1:1:1.000002');
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute28;
-CREATE PROCEDURE spexecute28()
-BEGIN
-declare var1 datetime;
-declare var2 datetime;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '1997-12-31 23:59:59.999999';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp28('1997-12-31 23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute28();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-02 01:01:00 1998-01-02 01:01:00 1998-01-03 02:02:01 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-02 01:01:00 1998-01-03 02:02:01 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute28;
-DROP PROCEDURE sp28;
-DROP PROCEDURE IF EXISTS sp29;
-CREATE PROCEDURE sp29( in f1 float(0) unsigned, inout f2 float(0) unsigned, out f3 float(0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute29;
-CREATE PROCEDURE spexecute29()
-BEGIN
-declare var1 float(0) unsigned;
-declare var2 float(0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp29(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute29();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute29;
-DROP PROCEDURE sp29;
-DROP PROCEDURE IF EXISTS sp30;
-CREATE PROCEDURE sp30( in f1 float(0) zerofill, inout f2 float(0) zerofill, out f3 float(0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute30;
-CREATE PROCEDURE spexecute30()
-BEGIN
-declare var1 float(0) zerofill;
-declare var2 float(0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp30(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute30();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute30;
-DROP PROCEDURE sp30;
-DROP PROCEDURE IF EXISTS sp31;
-CREATE PROCEDURE sp31( in f1 float(23), inout f2 float(23), out f3 float(23), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute31;
-CREATE PROCEDURE spexecute31()
-BEGIN
-declare var1 float(23);
-declare var2 float(23);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp31(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute31();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute31;
-DROP PROCEDURE sp31;
-DROP PROCEDURE IF EXISTS sp32;
-CREATE PROCEDURE sp32( in f1 float(23) unsigned, inout f2 float(23) unsigned, out f3 float(23) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute32;
-CREATE PROCEDURE spexecute32()
-BEGIN
-declare var1 float(23) unsigned;
-declare var2 float(23) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp32(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute32();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute32;
-DROP PROCEDURE sp32;
-DROP PROCEDURE IF EXISTS sp33;
-CREATE PROCEDURE sp33( in f1 float(23) zerofill, inout f2 float(23) zerofill, out f3 float(23) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute33;
-CREATE PROCEDURE spexecute33()
-BEGIN
-declare var1 float(23) zerofill;
-declare var2 float(23) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp33(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute33();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute33;
-DROP PROCEDURE sp33;
-DROP PROCEDURE IF EXISTS sp34;
-CREATE PROCEDURE sp34( in f1 float(24), inout f2 float(24), out f3 float(24), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute34;
-CREATE PROCEDURE spexecute34()
-BEGIN
-declare var1 float(24);
-declare var2 float(24);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp34(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute34();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute34;
-DROP PROCEDURE sp34;
-DROP PROCEDURE IF EXISTS sp35;
-CREATE PROCEDURE sp35( in f1 float(24) unsigned, inout f2 float(24) unsigned, out f3 float(24) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute35;
-CREATE PROCEDURE spexecute35()
-BEGIN
-declare var1 float(24) unsigned;
-declare var2 float(24) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp35(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute35();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute35;
-DROP PROCEDURE sp35;
-DROP PROCEDURE IF EXISTS sp36;
-CREATE PROCEDURE sp36( in f1 float(24) zerofill, inout f2 float(24) zerofill, out f3 float(24) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute36;
-CREATE PROCEDURE spexecute36()
-BEGIN
-declare var1 float(24) zerofill;
-declare var2 float(24) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp36(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute36();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute36;
-DROP PROCEDURE sp36;
-DROP PROCEDURE IF EXISTS sp37;
-CREATE PROCEDURE sp37( in f1 float(53), inout f2 float(53), out f3 float(53), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute37;
-CREATE PROCEDURE spexecute37()
-BEGIN
-declare var1 float(53);
-declare var2 float(53);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp37(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute37();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute37;
-DROP PROCEDURE sp37;
-DROP PROCEDURE IF EXISTS sp38;
-CREATE PROCEDURE sp38( in f1 float(53) unsigned, inout f2 float(53) unsigned, out f3 float(53) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute38;
-CREATE PROCEDURE spexecute38()
-BEGIN
-declare var1 float(53) unsigned;
-declare var2 float(53) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp38(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute38();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute38;
-DROP PROCEDURE sp38;
-DROP PROCEDURE IF EXISTS sp39;
-CREATE PROCEDURE sp39( in f1 float(53) zerofill, inout f2 float(53) zerofill, out f3 float(53) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute39;
-CREATE PROCEDURE spexecute39()
-BEGIN
-declare var1 float(53) zerofill;
-declare var2 float(53) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp39(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute39();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute39;
-DROP PROCEDURE sp39;
-DROP PROCEDURE IF EXISTS sp40;
-CREATE PROCEDURE sp40( in f1 real unsigned, inout f2 real unsigned, out f3 real unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute40;
-CREATE PROCEDURE spexecute40()
-BEGIN
-declare var1 real unsigned;
-declare var2 real unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp40(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute40();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute40;
-DROP PROCEDURE sp40;
-DROP PROCEDURE IF EXISTS sp41;
-CREATE PROCEDURE sp41( in f1 real unsigned zerofill, inout f2 real unsigned zerofill, out f3 real unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute41;
-CREATE PROCEDURE spexecute41()
-BEGIN
-declare var1 real unsigned zerofill;
-declare var2 real unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp41(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute41();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute41;
-DROP PROCEDURE sp41;
-DROP PROCEDURE IF EXISTS sp42;
-CREATE PROCEDURE sp42( in f1 real zerofill, inout f2 real zerofill, out f3 real zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute42;
-CREATE PROCEDURE spexecute42()
-BEGIN
-declare var1 real zerofill;
-declare var2 real zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp42(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute42();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute42;
-DROP PROCEDURE sp42;
-DROP PROCEDURE IF EXISTS sp43;
-CREATE PROCEDURE sp43( in f1 numeric (0), inout f2 numeric (0), out f3 numeric (0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute43;
-CREATE PROCEDURE spexecute43()
-BEGIN
-declare var1 numeric (0);
-declare var2 numeric (0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp43(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute43();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute43;
-DROP PROCEDURE sp43;
-DROP PROCEDURE IF EXISTS sp44;
-CREATE PROCEDURE sp44( in f1 numeric (0) unsigned, inout f2 numeric (0) unsigned, out f3 numeric (0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute44;
-CREATE PROCEDURE spexecute44()
-BEGIN
-declare var1 numeric (0) unsigned;
-declare var2 numeric (0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp44(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute44();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute44;
-DROP PROCEDURE sp44;
-DROP PROCEDURE IF EXISTS sp45;
-CREATE PROCEDURE sp45( in f1 numeric (0) zerofill, inout f2 numeric (0) zerofill, out f3 numeric (0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute45;
-CREATE PROCEDURE spexecute45()
-BEGIN
-declare var1 numeric (0) zerofill;
-declare var2 numeric (0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp45(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute45();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute45;
-DROP PROCEDURE sp45;
-DROP PROCEDURE IF EXISTS sp46;
-CREATE PROCEDURE sp46( in f1 numeric (0, 0), inout f2 numeric (0, 0), out f3 numeric (0, 0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute46;
-CREATE PROCEDURE spexecute46()
-BEGIN
-declare var1 numeric (0, 0);
-declare var2 numeric (0, 0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp46(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute46();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute46;
-DROP PROCEDURE sp46;
-DROP PROCEDURE IF EXISTS sp47;
-CREATE PROCEDURE sp47( in f1 numeric (0, 0) unsigned, inout f2 numeric (0, 0) unsigned, out f3 numeric (0, 0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute47;
-CREATE PROCEDURE spexecute47()
-BEGIN
-declare var1 numeric (0, 0) unsigned;
-declare var2 numeric (0, 0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp47(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute47();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute47;
-DROP PROCEDURE sp47;
-DROP PROCEDURE IF EXISTS sp48;
-CREATE PROCEDURE sp48( in f1 numeric (0, 0) zerofill, inout f2 numeric (0, 0) zerofill, out f3 numeric (0, 0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute48;
-CREATE PROCEDURE spexecute48()
-BEGIN
-declare var1 numeric (0, 0) zerofill;
-declare var2 numeric (0, 0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp48(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute48();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute48;
-DROP PROCEDURE sp48;
-DROP PROCEDURE IF EXISTS sp49;
-CREATE PROCEDURE sp49( in f1 numeric unsigned, inout f2 numeric unsigned, out f3 numeric unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute49;
-CREATE PROCEDURE spexecute49()
-BEGIN
-declare var1 numeric unsigned;
-declare var2 numeric unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp49(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute49();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute49;
-DROP PROCEDURE sp49;
-DROP PROCEDURE IF EXISTS sp50;
-CREATE PROCEDURE sp50( in f1 numeric unsigned zerofill, inout f2 numeric unsigned zerofill, out f3 numeric unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute50;
-CREATE PROCEDURE spexecute50()
-BEGIN
-declare var1 numeric unsigned zerofill;
-declare var2 numeric unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp50(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute50();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute50;
-DROP PROCEDURE sp50;
-DROP PROCEDURE IF EXISTS sp51;
-CREATE PROCEDURE sp51( in f1 numeric zerofill, inout f2 numeric zerofill, out f3 numeric zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute51;
-CREATE PROCEDURE spexecute51()
-BEGIN
-declare var1 numeric zerofill;
-declare var2 numeric zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp51(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute51();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute51;
-DROP PROCEDURE sp51;
-DROP PROCEDURE IF EXISTS sp52;
-CREATE PROCEDURE sp52( in f1 numeric (63, 30), inout f2 numeric (63, 30), out f3 numeric (63, 30), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute52;
-CREATE PROCEDURE spexecute52()
-BEGIN
-declare var1 numeric (63, 30);
-declare var2 numeric (63, 30);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp52(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute52();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000.000000000000000000000000000000 -10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute52;
-DROP PROCEDURE sp52;
-DROP PROCEDURE IF EXISTS sp53;
-CREATE PROCEDURE sp53( in f1 numeric (64), inout f2 numeric (64), out f3 numeric (64), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute53;
-CREATE PROCEDURE spexecute53()
-BEGIN
-declare var1 numeric (64);
-declare var2 numeric (64);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp53(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute53();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute53;
-DROP PROCEDURE sp53;
-DROP PROCEDURE IF EXISTS sp54;
-CREATE PROCEDURE sp54( in f1 numeric (64) unsigned, inout f2 numeric (64) unsigned, out f3 numeric (64) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute54;
-CREATE PROCEDURE spexecute54()
-BEGIN
-declare var1 numeric (64) unsigned;
-declare var2 numeric (64) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp54(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute54();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute54;
-DROP PROCEDURE sp54;
-DROP PROCEDURE IF EXISTS sp55;
-CREATE PROCEDURE sp55( in f1 numeric (64) zerofill, inout f2 numeric (64) zerofill, out f3 numeric (64) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute55;
-CREATE PROCEDURE spexecute55()
-BEGIN
-declare var1 numeric (64) zerofill;
-declare var2 numeric (64) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp55(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute55();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute55;
-DROP PROCEDURE sp55;
-DROP PROCEDURE IF EXISTS sp56;
-CREATE PROCEDURE sp56( in f1 year, inout f2 year, out f3 year, in f4 year, inout f5 year, out f6 year, in f7 year, inout f8 year, out f9 year, in f10 year, inout f11 year, out f12 year)
-BEGIN
-set f1 = f1 + 10; set f2 = f2 + 10; set f3 = f2 + 10;
-set f4 = f4 + 10; set f5 = f5 + 10; set f6 = f5 + 10;
-set f7 = f7 + 10; set f8 = f8 + 10; set f9 = f8 + 10;
-set f10= f10+ 10; set f11 = f11 + 10; set f12 = f11 + 10;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute56;
-CREATE PROCEDURE spexecute56()
-BEGIN
-declare var1 year;
-declare var2 year;
-declare var3 year;
-declare var4 year;
-declare var5 year;
-declare var6 year;
-declare var7 year;
-declare var8 year;
-set var1 = 51;
-set var3 = 51;
-set var5 = 51;
-set var7 = 51;
-CALL sp56(51, var1, var2, 51, var3, var4, 51, var5, var6, 51, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute56();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2061 2061 2071 2061 2061 2071 2061 2061 2071 2061 2061 2071
-var1 var2 var3 var4 var5 var6 var7 var8
-2061 2071 2061 2071 2061 2071 2061 2071
-DROP PROCEDURE spexecute56;
-DROP PROCEDURE sp56;
-DROP PROCEDURE IF EXISTS sp57;
-CREATE PROCEDURE sp57( in f1 year(4), inout f2 year(4), out f3 year(4), in f4 year(4), inout f5 year(4), out f6 year(4), in f7 year(4), inout f8 year(4), out f9 year(4), in f10 year(4), inout f11 year(4), out f12 year(4))
-BEGIN
-set f1 = f1 + 51; set f2 = f2 + 51; set f3 = f2 + 51;
-set f4 = f4 + 51; set f5 = f5 + 51; set f6 = f5 + 51;
-set f7 = f7 + 51; set f8 = f8 + 51; set f9 = f8 + 51;
-set f10 = f10 + 51; set f11 = f11 + 51; set f12 = f11 + 51;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute57;
-CREATE PROCEDURE spexecute57()
-BEGIN
-declare var1 year(4);
-declare var2 year(4);
-declare var3 year(4);
-declare var4 year(4);
-declare var5 year(4);
-declare var6 year(4);
-declare var7 year(4);
-declare var8 year(4);
-set var1 = 1982;
-set var3 = 1982;
-set var5 = 1982;
-set var7 = 1982;
-CALL sp57(1982, var1, var2, 1982, var3, var4, 1982, var5, var6, 1982, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute57();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2033 2033 2084 2033 2033 2084 2033 2033 2084 2033 2033 2084
-var1 var2 var3 var4 var5 var6 var7 var8
-2033 2084 2033 2084 2033 2084 2033 2084
-DROP PROCEDURE spexecute57;
-DROP PROCEDURE sp57;
-DROP PROCEDURE IF EXISTS sp58;
-CREATE PROCEDURE sp58( in f1 text, inout f2 text, out f3 text, in f4 text, inout f5 text, out f6 text, in f7 text, inout f8 text, out f9 text, in f10 text, inout f11 text, out f12 text)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute58;
-CREATE PROCEDURE spexecute58()
-BEGIN
-declare var1 text;
-declare var2 text;
-declare var3 text;
-declare var4 text;
-declare var5 text;
-declare var6 text;
-declare var7 text;
-declare var8 text;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp58( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute58();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute58;
-DROP PROCEDURE sp58;
-DROP PROCEDURE IF EXISTS sp59;
-CREATE PROCEDURE sp59( in f1 tinytext, inout f2 tinytext, out f3 tinytext, in f4 tinytext, inout f5 tinytext, out f6 tinytext, in f7 tinytext, inout f8 tinytext, out f9 tinytext, in f10 tinytext, inout f11 tinytext, out f12 tinytext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute59;
-CREATE PROCEDURE spexecute59()
-BEGIN
-declare var1 tinytext;
-declare var2 tinytext;
-declare var3 tinytext;
-declare var4 tinytext;
-declare var5 tinytext;
-declare var6 tinytext;
-declare var7 tinytext;
-declare var8 tinytext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp59( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute59();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute59;
-DROP PROCEDURE sp59;
-DROP PROCEDURE IF EXISTS sp60;
-CREATE PROCEDURE sp60( in f1 char, inout f2 char, out f3 char, in f4 char, inout f5 char, out f6 char, in f7 char, inout f8 char, out f9 char, in f10 char, inout f11 char, out f12 char)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f1);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f5);
-set f7 = concat('a', f7); set f8 = concat('a', f8); set f9 = concat('a', f8);
-set f10 = concat('a', f10); set f11 = concat('a', f11); set f12 = concat('a', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute60;
-CREATE PROCEDURE spexecute60()
-BEGIN
-declare var1 char;
-declare var2 char;
-declare var3 char;
-declare var4 char;
-declare var5 char;
-declare var6 char;
-declare var7 char;
-declare var8 char;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'h';
-set var7 = 'h';
-CALL sp60( 'h', var1, var2, 'h', var3, var4, 'h', var5, var6, 'h', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute60();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a a a a a a a
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a a a a a
-DROP PROCEDURE spexecute60;
-DROP PROCEDURE sp60;
-DROP PROCEDURE IF EXISTS sp61;
-CREATE PROCEDURE sp61( in f1 char ascii, inout f2 char ascii, out f3 char ascii, in f4 char ascii, inout f5 char ascii, out f6 char ascii, in f7 char ascii, inout f8 char ascii, out f9 char ascii, in f10 char ascii, inout f11 char ascii, out f12 char ascii)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f2);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f4);
-set f7 = concat('a', f7); set f8 = concat('a', f8); set f9 = concat('a', f9);
-set f10 = concat('a', f10); set f11 = concat('a', f11); set f12 = concat('a', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute61;
-CREATE PROCEDURE spexecute61()
-BEGIN
-declare var1 char ascii;
-declare var2 char ascii;
-declare var3 char ascii;
-declare var4 char ascii;
-declare var5 char ascii;
-declare var6 char ascii;
-declare var7 char ascii;
-declare var8 char ascii;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'h';
-set var7 = 'h';
-CALL sp61( 'h', var1, var2, 'h', var3, var4, 'h', var5, var6, 'h', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute61();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a a a NULL a a a
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a a NULL a a
-DROP PROCEDURE spexecute61;
-DROP PROCEDURE sp61;
-DROP PROCEDURE IF EXISTS sp62;
-CREATE PROCEDURE sp62( in f1 longtext, inout f2 longtext, out f3 longtext, in f4 longtext, inout f5 longtext, out f6 longtext, in f7 longtext, inout f8 longtext, out f9 longtext, in f10 longtext, inout f11 longtext, out f12 longtext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute62;
-CREATE PROCEDURE spexecute62()
-BEGIN
-declare var1 longtext;
-declare var2 longtext;
-declare var3 longtext;
-declare var4 longtext;
-declare var5 longtext;
-declare var6 longtext;
-declare var7 longtext;
-declare var8 longtext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp62( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute62();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute62;
-DROP PROCEDURE sp62;
-DROP PROCEDURE IF EXISTS sp63;
-CREATE PROCEDURE sp63( in f1 mediumtext, inout f2 mediumtext, out f3 mediumtext, in f4 mediumtext, inout f5 mediumtext, out f6 mediumtext, in f7 mediumtext, inout f8 mediumtext, out f9 mediumtext, in f10 mediumtext, inout f11 mediumtext, out f12 mediumtext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f3);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute63;
-CREATE PROCEDURE spexecute63()
-BEGIN
-declare var1 mediumtext;
-declare var2 mediumtext;
-declare var3 mediumtext;
-declare var4 mediumtext;
-declare var5 mediumtext;
-declare var6 mediumtext;
-declare var7 mediumtext;
-declare var8 mediumtext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp63( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute63();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld NULL helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld NULL helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute63;
-DROP PROCEDURE sp63;
-DROP PROCEDURE IF EXISTS sp64;
-CREATE PROCEDURE sp64( in f1 decimal, inout f2 decimal, out f3 decimal, in f4 decimal, inout f5 decimal, out f6 decimal, in f7 decimal, inout f8 decimal, out f9 decimal, in f10 decimal, inout f11 decimal, out f12 decimal)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f4 = (f4 / 2); set f4 = (f4 * 2); set f4 = (f4 - 10); set f4 = (f4 + 10); set f5 = (f5 / 2); set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f5 / 2); set f6 = (f5 * 2); set f6 = (f5 - 10); set f6 = (f5 + 10);
-set f7 = (f7 / 2); set f7 = (f7 * 2); set f7 = (f7 - 10); set f7 = (f7 + 10); set f8 = (f8 / 2); set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f8 / 2); set f9 = (f8 * 2); set f9 = (f8 - 10); set f9 = (f8 + 10);
-set f10 = (f10 / 2); set f10 = (f10 * 2); set f10 = (f10 - 10); set f10 = (f10 + 10); set f11 = (f11 / 2); set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f11 / 2); set f12 = (f11 * 2); set f12 = (f11 - 10); set f12 = (f11 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute64;
-CREATE PROCEDURE spexecute64()
-BEGIN
-declare var1 decimal;
-declare var2 decimal;
-declare var3 decimal;
-declare var4 decimal;
-declare var5 decimal;
-declare var6 decimal;
-declare var7 decimal;
-declare var8 decimal;
-set var1 = --1.00e+09;
-set var3 = --1.00e+09;
-set var5 = --1.00e+09;
-set var7 = --1.00e+09;
-CALL sp64(--1.00e+09, var1, var2, --1.00e+09, var3, var4, --1.00e+09, var5, var6, --1.00e+09, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute64();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 1000000000 1000000000 1000000010 1000000000 1000000000 1000000010 1000000000 1000000000 1000000010
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 1000000000 1000000010 1000000000 1000000010 1000000000 1000000010
-DROP PROCEDURE spexecute64;
-DROP PROCEDURE sp64;
-DROP PROCEDURE IF EXISTS sp65;
-CREATE PROCEDURE sp65( in f1 decimal (0, 0) unsigned zerofill, inout f2 decimal (0, 0) unsigned zerofill, out f3 decimal (0, 0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute65;
-CREATE PROCEDURE spexecute65()
-BEGIN
-declare var1 decimal (0, 0) unsigned zerofill;
-declare var2 decimal (0, 0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp65(999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute65();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute65;
-DROP PROCEDURE sp65;
-DROP PROCEDURE IF EXISTS sp66;
-CREATE PROCEDURE sp66( in f1 decimal (63, 30) unsigned, inout f2 decimal (63, 30) unsigned, out f3 decimal (63, 30) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute66;
-CREATE PROCEDURE spexecute66()
-BEGIN
-declare var1 decimal (63, 30) unsigned;
-declare var2 decimal (63, 30) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+16;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp66(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute66();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10000000000000000.000000000000000000000000000000 10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute66;
-DROP PROCEDURE sp66;
-DROP PROCEDURE IF EXISTS sp67;
-CREATE PROCEDURE sp67( in f1 decimal (63, 30) unsigned zerofill, inout f2 decimal (63, 30) unsigned zerofill, out f3 decimal (63, 30) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute67;
-CREATE PROCEDURE spexecute67()
-BEGIN
-declare var1 decimal (63, 30) unsigned zerofill;
-declare var2 decimal (63, 30) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+16;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp67(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute67();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute67;
-DROP PROCEDURE sp67;
-DROP PROCEDURE IF EXISTS sp68;
-CREATE PROCEDURE sp68( in f1 decimal (63, 30) zerofill, inout f2 decimal (63, 30) zerofill, out f3 decimal (63, 30) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute68;
-CREATE PROCEDURE spexecute68()
-BEGIN
-declare var1 decimal (63, 30) zerofill;
-declare var2 decimal (63, 30) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+21;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp68(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute68();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute68;
-DROP PROCEDURE sp68;
-DROP PROCEDURE IF EXISTS sp69;
-CREATE PROCEDURE sp69( in f1 decimal (64), inout f2 decimal (64), out f3 decimal (64), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute69;
-CREATE PROCEDURE spexecute69()
-BEGIN
-declare var1 decimal (64);
-declare var2 decimal (64);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp69(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute69();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute69;
-DROP PROCEDURE sp69;
-DROP PROCEDURE IF EXISTS sp70;
-CREATE PROCEDURE sp70( in f1 decimal (64) unsigned, inout f2 decimal (64) unsigned, out f3 decimal (64) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute70;
-CREATE PROCEDURE spexecute70()
-BEGIN
-declare var1 decimal (64) unsigned;
-declare var2 decimal (64) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp70(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute70();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute70;
-DROP PROCEDURE sp70;
-DROP PROCEDURE IF EXISTS sp71;
-CREATE PROCEDURE sp71( in f1 decimal (64) unsigned zerofill, inout f2 decimal (64) unsigned zerofill, out f3 decimal (64) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute71;
-CREATE PROCEDURE spexecute71()
-BEGIN
-declare var1 decimal (64) unsigned zerofill;
-declare var2 decimal (64) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp71(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute71();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute71;
-DROP PROCEDURE sp71;
-DROP PROCEDURE IF EXISTS sp72;
-CREATE PROCEDURE sp72( in f1 decimal (64) zerofill, inout f2 decimal (64) zerofill, out f3 decimal (64) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute72;
-CREATE PROCEDURE spexecute72()
-BEGIN
-declare var1 decimal (64) zerofill;
-declare var2 decimal (64) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp72(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute72();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute72;
-DROP PROCEDURE sp72;
-DROP PROCEDURE IF EXISTS sp73;
-CREATE PROCEDURE sp73( in f1 decimal unsigned, inout f2 decimal unsigned, out f3 decimal unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute73;
-CREATE PROCEDURE spexecute73()
-BEGIN
-declare var1 decimal unsigned;
-declare var2 decimal unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp73(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute73();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute73;
-DROP PROCEDURE sp73;
-DROP PROCEDURE IF EXISTS sp74;
-CREATE PROCEDURE sp74( in f1 decimal unsigned zerofill, inout f2 decimal unsigned zerofill, out f3 decimal unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute74;
-CREATE PROCEDURE spexecute74()
-BEGIN
-declare var1 decimal unsigned zerofill;
-declare var2 decimal unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp74(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute74();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute74;
-DROP PROCEDURE sp74;
-DROP PROCEDURE IF EXISTS sp75;
-CREATE PROCEDURE sp75( in f1 decimal zerofill, inout f2 decimal zerofill, out f3 decimal zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute75;
-CREATE PROCEDURE spexecute75()
-BEGIN
-declare var1 decimal zerofill;
-declare var2 decimal zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp75(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute75();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute75;
-DROP PROCEDURE sp75;
-DROP PROCEDURE IF EXISTS sp76;
-CREATE PROCEDURE sp76( in f1 float(0) unsigned zerofill, inout f2 float(0) unsigned zerofill, out f3 float(0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute76;
-CREATE PROCEDURE spexecute76()
-BEGIN
-declare var1 float(0) unsigned zerofill;
-declare var2 float(0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp76(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute76();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute76;
-DROP PROCEDURE sp76;
-DROP PROCEDURE IF EXISTS sp77;
-CREATE PROCEDURE sp77( in f1 float(23) unsigned zerofill, inout f2 float(23) unsigned zerofill, out f3 float(23) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute77;
-CREATE PROCEDURE spexecute77()
-BEGIN
-declare var1 float(23) unsigned zerofill;
-declare var2 float(23) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp77(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute77();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute77;
-DROP PROCEDURE sp77;
-DROP PROCEDURE IF EXISTS sp78;
-CREATE PROCEDURE sp78( in f1 float(24) unsigned zerofill, inout f2 float(24) unsigned zerofill, out f3 float(24) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute78;
-CREATE PROCEDURE spexecute78()
-BEGIN
-declare var1 float(24) unsigned zerofill;
-declare var2 float(24) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp78(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute78();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute78;
-DROP PROCEDURE sp78;
-DROP PROCEDURE IF EXISTS sp79;
-CREATE PROCEDURE sp79( in f1 float(53) unsigned zerofill, inout f2 float(53) unsigned zerofill, out f3 float(53) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute79;
-CREATE PROCEDURE spexecute79()
-BEGIN
-declare var1 float(53) unsigned zerofill;
-declare var2 float(53) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp79(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute79();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute79;
-DROP PROCEDURE sp79;
-DROP PROCEDURE IF EXISTS sp80;
-CREATE PROCEDURE sp80( in f1 int, inout f2 int, out f3 int, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute80;
-CREATE PROCEDURE spexecute80()
-BEGIN
-declare var1 int;
-declare var2 int;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -2.15e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp80(-2.15e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute80();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--2147483638 -2147483638 -2147483628 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--2147483638 -2147483628 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute80;
-DROP PROCEDURE sp80;
-DROP PROCEDURE IF EXISTS sp81;
-CREATE PROCEDURE sp81( in f1 int unsigned, inout f2 int unsigned, out f3 int unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute81;
-CREATE PROCEDURE spexecute81()
-BEGIN
-declare var1 int unsigned;
-declare var2 int unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 4.29e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp81(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute81();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute81;
-DROP PROCEDURE sp81;
-DROP PROCEDURE IF EXISTS sp82;
-CREATE PROCEDURE sp82( in f1 int unsigned zerofill, inout f2 int unsigned zerofill, out f3 int unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute82;
-CREATE PROCEDURE spexecute82()
-BEGIN
-declare var1 int unsigned zerofill;
-declare var2 int unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 4.29e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp82(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute82();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute82;
-DROP PROCEDURE sp82;
-DROP PROCEDURE IF EXISTS sp83;
-CREATE PROCEDURE sp83( in f1 int zerofill, inout f2 int zerofill, out f3 int zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute83;
-CREATE PROCEDURE spexecute83()
-BEGIN
-declare var1 int zerofill;
-declare var2 int zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 2.15e+08;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp83(2.15e+08, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute83();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0215000000 0215000000 0215000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0215000000 0215000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute83;
-DROP PROCEDURE sp83;
-DROP PROCEDURE IF EXISTS sp84;
-CREATE PROCEDURE sp84( in f1 mediumint, inout f2 mediumint, out f3 mediumint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute84;
-CREATE PROCEDURE spexecute84()
-BEGIN
-declare var1 mediumint;
-declare var2 mediumint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -8388600;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp84(-8388600, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute84();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--8388598 -8388598 -8388588 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--8388598 -8388588 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute84;
-DROP PROCEDURE sp84;
-DROP PROCEDURE IF EXISTS sp85;
-CREATE PROCEDURE sp85( in f1 mediumint unsigned, inout f2 mediumint unsigned, out f3 mediumint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute85;
-CREATE PROCEDURE spexecute85()
-BEGIN
-declare var1 mediumint unsigned;
-declare var2 mediumint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 16777201;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp85(16777201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute85();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777202 16777202 16777212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777202 16777212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute85;
-DROP PROCEDURE sp85;
-DROP PROCEDURE IF EXISTS sp86;
-CREATE PROCEDURE sp86( in f1 mediumint unsigned zerofill, inout f2 mediumint unsigned zerofill, out f3 mediumint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute86;
-CREATE PROCEDURE spexecute86()
-BEGIN
-declare var1 mediumint unsigned zerofill;
-declare var2 mediumint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 16777210;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp86(16777210, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute86();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777210 16777210 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777210 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute86;
-DROP PROCEDURE sp86;
-DROP PROCEDURE IF EXISTS sp87;
-CREATE PROCEDURE sp87( in f1 mediumint zerofill, inout f2 mediumint zerofill, out f3 mediumint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute87;
-CREATE PROCEDURE spexecute87()
-BEGIN
-declare var1 mediumint zerofill;
-declare var2 mediumint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -8388601;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp87(-8388601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute87();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777215 16777215 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777215 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute87;
-DROP PROCEDURE sp87;
-DROP PROCEDURE IF EXISTS sp88;
-CREATE PROCEDURE sp88( in f1 numeric (0) unsigned zerofill, inout f2 numeric (0) unsigned zerofill, out f3 numeric (0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute88;
-CREATE PROCEDURE spexecute88()
-BEGIN
-declare var1 numeric (0) unsigned zerofill;
-declare var2 numeric (0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp88(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute88();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute88;
-DROP PROCEDURE sp88;
-DROP PROCEDURE IF EXISTS sp89;
-CREATE PROCEDURE sp89( in f1 numeric (0, 0) unsigned zerofill, inout f2 numeric (0, 0) unsigned zerofill, out f3 numeric (0, 0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute89;
-CREATE PROCEDURE spexecute89()
-BEGIN
-declare var1 numeric (0, 0) unsigned zerofill;
-declare var2 numeric (0, 0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp89(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute89();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute89;
-DROP PROCEDURE sp89;
-DROP PROCEDURE IF EXISTS sp90;
-CREATE PROCEDURE sp90( in f1 numeric (63, 30) unsigned, inout f2 numeric (63, 30) unsigned, out f3 numeric (63, 30) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute90;
-CREATE PROCEDURE spexecute90()
-BEGIN
-declare var1 numeric (63, 30) unsigned;
-declare var2 numeric (63, 30) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp90(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute90();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000.000000000000000000000000000000 10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute90;
-DROP PROCEDURE sp90;
-DROP PROCEDURE IF EXISTS sp91;
-CREATE PROCEDURE sp91( in f1 numeric (63, 30) unsigned zerofill, inout f2 numeric (63, 30) unsigned zerofill, out f3 numeric (63, 30) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute91;
-CREATE PROCEDURE spexecute91()
-BEGIN
-declare var1 numeric (63, 30) unsigned zerofill;
-declare var2 numeric (63, 30) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp91(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute91();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000100000000000000000000.000000000000000000000000000000 000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute91;
-DROP PROCEDURE sp91;
-DROP PROCEDURE IF EXISTS sp92;
-CREATE PROCEDURE sp92( in f1 numeric (63, 30) zerofill, inout f2 numeric (63, 30) zerofill, out f3 numeric (63, 30) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute92;
-CREATE PROCEDURE spexecute92()
-BEGIN
-declare var1 numeric (63, 30) zerofill;
-declare var2 numeric (63, 30) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp92(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute92();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute92;
-DROP PROCEDURE sp92;
-DROP PROCEDURE IF EXISTS sp93;
-CREATE PROCEDURE sp93( in f1 numeric (64) unsigned zerofill, inout f2 numeric (64) unsigned zerofill, out f3 numeric (64) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute93;
-CREATE PROCEDURE spexecute93()
-BEGIN
-declare var1 numeric (64) unsigned zerofill;
-declare var2 numeric (64) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp93(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute93();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute93;
-DROP PROCEDURE sp93;
-DROP PROCEDURE IF EXISTS sp94;
-CREATE PROCEDURE sp94( in f1 smallint, inout f2 smallint, out f3 smallint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute94;
-CREATE PROCEDURE spexecute94()
-BEGIN
-declare var1 smallint;
-declare var2 smallint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32701;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp94(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute94();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32702 -32702 -32692 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32702 -32692 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute94;
-DROP PROCEDURE sp94;
-DROP PROCEDURE IF EXISTS sp95;
-CREATE PROCEDURE sp95( in f1 smallint unsigned, inout f2 smallint unsigned, out f3 smallint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute95;
-CREATE PROCEDURE spexecute95()
-BEGIN
-declare var1 smallint unsigned;
-declare var2 smallint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 65531;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp95(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute95();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute95;
-DROP PROCEDURE sp95;
-DROP PROCEDURE IF EXISTS sp96;
-CREATE PROCEDURE sp96( in f1 smallint unsigned zerofill, inout f2 smallint unsigned zerofill, out f3 smallint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute96;
-CREATE PROCEDURE spexecute96()
-BEGIN
-declare var1 smallint unsigned zerofill;
-declare var2 smallint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 65531;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp96(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute96();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute96;
-DROP PROCEDURE sp96;
-DROP PROCEDURE IF EXISTS sp97;
-CREATE PROCEDURE sp97( in f1 smallint zerofill, inout f2 smallint zerofill, out f3 smallint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute97;
-CREATE PROCEDURE spexecute97()
-BEGIN
-declare var1 smallint zerofill;
-declare var2 smallint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32601;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp97(-32601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute97();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65535 65535 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65535 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute97;
-DROP PROCEDURE sp97;
-DROP PROCEDURE IF EXISTS sp98;
-CREATE PROCEDURE sp98( in f1 tinyint, inout f2 tinyint, out f3 tinyint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute98;
-CREATE PROCEDURE spexecute98()
-BEGIN
-declare var1 tinyint;
-declare var2 tinyint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -115;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp98(-115, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute98();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--116 -116 -106 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--116 -106 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute98;
-DROP PROCEDURE sp98;
-DROP PROCEDURE IF EXISTS sp99;
-CREATE PROCEDURE sp99( in f1 tinyint unsigned, inout f2 tinyint unsigned, out f3 tinyint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute99;
-CREATE PROCEDURE spexecute99()
-BEGIN
-declare var1 tinyint unsigned;
-declare var2 tinyint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 251;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp99(251, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute99();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-252 252 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-252 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute99;
-DROP PROCEDURE sp99;
-DROP PROCEDURE IF EXISTS sp100;
-CREATE PROCEDURE sp100( in f1 tinyint unsigned zerofill, inout f2 tinyint unsigned zerofill, out f3 tinyint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute100;
-CREATE PROCEDURE spexecute100()
-BEGIN
-declare var1 tinyint unsigned zerofill;
-declare var2 tinyint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 201;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp100(201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute100();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-202 202 212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-202 212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute100;
-DROP PROCEDURE sp100;
-DROP PROCEDURE IF EXISTS sp101;
-CREATE PROCEDURE sp101( in f1 tinyint zerofill, inout f2 tinyint zerofill, out f3 tinyint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute101;
-CREATE PROCEDURE spexecute101()
-BEGIN
-declare var1 tinyint zerofill;
-declare var2 tinyint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -101;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp101(-101, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute101();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-255 255 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-255 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute101;
-DROP PROCEDURE sp101;
-USE db_storedproc;
-DROP DATABASE db1;
-USE db_storedproc;
-
-Testcase 4.7.2:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for "allow_invalid_dates" server sql mode
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-drop table IF EXISTS temp_table;
-create table temp_table (f1 datetime);
-set @@sql_mode = 'allow_invalid_dates';
-CREATE PROCEDURE sp2 ()
-BEGIN
-declare a datetime;
-set a = '2005-03-14 01:01:02';
-insert into temp_table values(a);
-END//
-show CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 ALLOW_INVALID_DATES CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
-BEGIN
-declare a datetime;
-set a = '2005-03-14 01:01:02';
-insert into temp_table values(a);
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode = 'traditional';
-CALL sp2 ();
-SELECT * from temp_table;
-f1
-2005-03-14 01:01:02
-SELECT @@sql_mode;
-@@sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-DROP PROCEDURE sp2;
-drop table temp_table;
-
-Testcase 4.7.3:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for *high_not_precedence* server sql mode
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp3;
-set @@sql_mode = 'high_not_precedence';
-CREATE PROCEDURE sp3()
-BEGIN
-declare a int signed;
-declare b int unsigned;
-set a = -5;
-set b = 5;
-SELECT not 1 between a and b;
-END//
-show CREATE PROCEDURE sp3;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp3 HIGH_NOT_PRECEDENCE CREATE DEFINER=`root`@`localhost` PROCEDURE `sp3`()
-BEGIN
-declare a int signed;
-declare b int unsigned;
-set a = -5;
-set b = 5;
-SELECT not 1 between a and b;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-CALL sp3();
-not 1 between a and b
-1
-SELECT @@sql_mode;
-@@sql_mode
-
-DROP PROCEDURE sp3;
-
-Testcase 4.7.4:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for combination of server sql modes
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp4;
-set @@sql_mode = 'ansi, error_for_division_by_zero';
-ERROR 42000: Variable 'sql_mode' can't be set to the value of ' error_for_division_by_zero'
-set @@sql_mode = 'ansi,error_for_division_by_zero';
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO
-CREATE PROCEDURE sp4()
-BEGIN
-declare a int;
-declare b int;
-declare c int;
-set a = 0;
-set b = 1;
-set c = b/a;
-show warnings;
-END//
-show CREATE PROCEDURE sp4;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO CREATE DEFINER="root"@"localhost" PROCEDURE "sp4"()
-BEGIN
-declare a int;
-declare b int;
-declare c int;
-set a = 0;
-set b = 1;
-set c = b/a;
-show warnings;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-CALL sp4();
-Level Code Message
-Error 1365 Division by 0
-Warnings:
-Error 1365 Division by 0
-DROP PROCEDURE sp4;
-set @@sql_mode='';
-
-Section 3.1.8 - SHOW statement checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.8.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-DROP PROCEDURE IF EXISTS sp6a;
-DROP PROCEDURE IF EXISTS sp6b;
-DROP PROCEDURE IF EXISTS sp6c;
-CREATE PROCEDURE sp6a (i1 longtext, out i2 mediumint , inout i3 longblob, in i4 year, out i5 real)
-language sql
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-CREATE PROCEDURE sp6b (out i1 longtext, out i2 mediumint , out i3 longblob, out i4 year, out i5 real)
-deterministic
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-CREATE PROCEDURE sp6c (inout i1 longtext, inout i2 mediumint , inout i3 longblob, inout i4 year, inout i5 real) comment 'this is a comment'
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-show CREATE PROCEDURE sp6a;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6a CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6a`(i1 longtext, out i2 mediumint , inout i3 longblob, in i4 year, out i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-show CREATE PROCEDURE sp6b;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6b CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6b`(out i1 longtext, out i2 mediumint , out i3 longblob, out i4 year, out i5 real)
- DETERMINISTIC
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-show CREATE PROCEDURE sp6c;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6c CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6c`(inout i1 longtext, inout i2 mediumint , inout i3 longblob, inout i4 year, inout i5 real)
- COMMENT 'this is a comment'
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6a';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6a PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6b';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6b PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6c';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6c PROCEDURE root@localhost modified created DEFINER this is a comment latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6a;
-DROP PROCEDURE sp6b;
-DROP PROCEDURE sp6c;
-
-Testcase 4.8.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-SHOW CREATE FUNCTION sp6;
-ERROR 42000: FUNCTION sp6 does not exist
-DROP PROCEDURE sp6;
-
-Testcase 4.8.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE FUNCTION sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) returns longtext
-BEGIN
-set @x=i1;
-set @y=@x;
-return 0;
-END//
-show function status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION sp6;
-
-Testcase 4.8.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7;
-show CREATE PROCEDURE sp7;
-ERROR 42000: PROCEDURE sp7 does not exist
-
-Testcase 4.8.6:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-show procedure status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.7:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-show CREATE PROCEDURE fn1;
-ERROR 42000: PROCEDURE fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 4.8.8:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-show procedure status like 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP FUNCTION fn1;
-
-Testcase 4.8.9:
---------------------------------------------------------------------------------
-
-Testcase 4.8.10:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.11:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-show CREATE PROCEDURE fn1;
-ERROR 42000: PROCEDURE fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 4.8.12:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(x int) returns int
-BEGIN
-return x;
-END//
-DROP FUNCTION fn1;
-show CREATE FUNCTION fn1;
-ERROR 42000: FUNCTION fn1 does not exist
-
-Testcase 4.8.13:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS f1000;
-SHOW FUNCTION STATUS LIKE 'f1000';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.14:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-SELECT * from t8;
-END//
-show CREATE FUNCTION sp1;
-ERROR 42000: FUNCTION sp1 does not exist
-DROP PROCEDURE sp1;
-
-Testcase 4.8.15:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-show function status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP PROCEDURE sp6;
-
-Testcase 4.8.16:
---------------------------------------------------------------------------------
-
-Testcase 4.8.17:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-alter procedure sp6 sql security invoker;
-alter procedure sp6 comment 'this is a new comment';
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created INVOKER this is a new comment latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.18:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-alter function fn1 sql security invoker;
-show create function fn1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
- SQL SECURITY INVOKER
-BEGIN
-return x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.19:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 longtext) returns longtext
-BEGIN
-return i1;
-END//
-alter function fn1 sql security invoker;
-alter function fn1 comment 'this is a function 3242#@%$#@';
-show function status like 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is a function 3242#@%$#@ latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.20:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 int , i2 int)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-alter procedure sp6 comment 'this is simple';
-show CREATE PROCEDURE sp6;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6`(i1 int , i2 int)
- COMMENT 'this is simple'
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.21:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 int, i2 int)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-DROP PROCEDURE sp6;
-show CREATE PROCEDURE sp6;
-ERROR 42000: PROCEDURE sp6 does not exist
-
-Testcase 4.8.22:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i3;
-set @y=@x;
-END//
-DROP PROCEDURE sp6;
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.23:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-DROP FUNCTION fn1;
-show CREATE FUNCTION fn1;
-ERROR 42000: FUNCTION fn1 does not exist
-
-Testcase 4.8.24:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 longtext) returns longtext
-BEGIN
-return i1;
-END//
-DROP FUNCTION fn1;
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Section 3.1.9 - Routine body checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.9.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-SELECT * from t9 limit 0, 100;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
--4991 a_aaaaaaaaa -4991
--4992 a^aaaaaaaa -4992
--4993 agaaaaaaa -4993
--4994 afaaaaaa -4994
--4995 aeaaaaa -4995
--4996 adaaaa -4996
--4997 acaaa -4997
--4998 abaa -4998
--4999 aaa -4999
--5000 a` -5000
-DROP PROCEDURE sp6;
-
-Testcase 4.9.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-delete from res_t9;
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-f1 f2 f3
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-update res_t9 set f2 = 1000 where f2 = 50;
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-f1 f2 f3
-30 1000 111
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i1;
-set @y = i3;
-set @z = i5;
-set @a = @x;
-set @b = @y;
-set @c = @z;
-create table res_t9(f1 longtext, f2 longblob, f3 real);
-insert into res_t9 values (@a, @b, @c);
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-10 30 50
-DROP PROCEDURE sp6;
-drop table IF EXISTS res_t9;
-
-Testcase 4.9.6:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-SELECT * from t9 limit 0, 100;
-return i1;
-END//
-ERROR 0A000: Not allowed to return a result set from a function
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-Warnings:
-Note 1051 Unknown table 'res_t9'
-create table res_t9 (f1 int, f2 char(25), f3 int);
-insert into res_t9 values (10, 'abc', 20);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-delete from res_t9;
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-create table res_t9 (f1 longtext, f2 longblob, f3 real);
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-Warnings:
-Note 1051 Unknown table 'res_t9'
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-insert into res_t9 values (100, 'abc', 300);
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-insert into res_t9 values (10, 'abc', 20);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-update res_t9 set f1 = 20;
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-drop table res_t9;
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-
-Testcase 4.9.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 longtext, f2 longblob, f3 real);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i1;
-set @y = i3;
-set @z = i5;
-set @a = @x;
-set @b = @y;
-set @c = @z;
-insert into res_t9 values (@a, @b, @c);
-SELECT * from res_t9;
-create index index_1 on res_t9 (f1 (5));
-show index from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-10 30 50
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-res_t9 1 index_1 1 f1 A NULL 5 NULL YES BTREE
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Section 3.1._ - :
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.11.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1305 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @xx=1;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for 1318 set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for 1305 set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1 ();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.6:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.8:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.9:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @xx=1;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.10:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1 ();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.11:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.12:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.13:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-fetch cur1 into a, b;
-SELECT done;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.14:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-fetch cur1 into a, b;
-SELECT done;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.15:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-set @x=0;
-fetch cur1 into a, b;
-SELECT @x=1;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-@x=1
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.16:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-set @x=0;
-fetch cur1 into a, b;
-SELECT @x=1;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-@x=1
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.17:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate 'HY000' set done = 1;
-open cur1;
-SELECT done;
-fetch cur1 into a;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.18:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1328 set done = 1;
-open cur1;
-SELECT done;
-fetch cur1 into a;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.19:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate 'HY000' set done = 1;
-open cur1;
-SELECT done;
-set @x=0;
-fetch cur1 into a;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.20:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1328 set done = 1;
-open cur1;
-SELECT done;
-set @x=0;
-fetch cur1 into a;
-set @x=1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.21:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1325 set done = 1;
-open cur1;
-SELECT done;
-open cur1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.22:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1325 set done = 1;
-open cur1;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.23:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1325 set done = 1;
-open cur1;
-set @x=0;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.24:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '24000' set done = 1;
-open cur1;
-set @x=0;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.25:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1326 set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.26:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '24000' set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.27:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1326 set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.28:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '24000' set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.29:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1339 set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.30:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '20000' set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.31:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1339 set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.32:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '20000' set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.33:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-CREATE PROCEDURE h1()
-BEGIN
-declare condname condition for sqlstate '20000';
-declare done int default 0;
-declare a, b char;
-declare condname condition for sqlstate '20000';
-declare cur1 cursor for SELECT w, x from t1;
-set @x=2;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-ERROR 42000: Duplicate condition: condname
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.35:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-CREATE TABLE res_t1(w INT UNIQUE, x CHAR);
-insert into res_t1 values (1, 'a');
-CREATE PROCEDURE h1 ()
-begin1_label:BEGIN
-declare condname1 condition for sqlstate '020';
-declare condname2 condition for sqlstate 'wewe';
-declare condname3 condition for 9999;
-declare exit handler for sqlstate '020' set @var1 = 1;
-declare exit handler for sqlstate 'wewe'set @var1 = 1;
-declare exit handler for 9999 set @var1 = 1;
-set @var2 = 1;
-insert into res_t1 values (2, 'b');
-begin2_label: BEGIN
-declare continue handler for sqlstate '90000023' set @var3= 1;
-set @var4 = 1;
-insert into res_t1 values (3, 'c');
-END begin2_label;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '020'
-CREATE PROCEDURE h1 ()
-begin1_label:BEGIN
-declare condname1 condition for sqlstate '020';
-declare condname2 condition for sqlstate 'wewe';
-declare condname3 condition for 9999;
-set @var2 = 1;
-insert into res_t1 values (2, 'b');
-begin2_label: BEGIN
-declare continue handler for sqlstate '90000023' set @var3= 1;
-set @var4 = 1;
-insert into res_t1 values (3, 'c');
-END begin2_label;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '020'
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.36:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for condname1 set @x = 1;
-set x1 = 1;
-set x1 = 2;
-END;
-SELECT @x, x1;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-DROP PROCEDURE IF EXISTS h1;
-
-Testcase 4.11.40:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char unique, x char);
-insert into res_t1 values ('a', 'b');
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5 int default 0;
-declare condname1 condition for sqlstate '42000';
-declare condname2 condition for sqlstate '42000';
-declare continue handler for condname1 set x1 = 1;
-declare continue handler for condname1 set x2 = 1;
-declare exit handler for condname1 set x3 = 1;
-declare continue handler for condname2 set x4 = 1;
-declare exit handler for condname2 set x5 = 1;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.41:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for sqlstate '00000' set @x = 1;
-set x1 = 1;
-set x1 = 2;
-END;
-SELECT @x, x1;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-CALL h1();
-ERROR 42000: PROCEDURE db_storedproc.h1 does not exist
-DROP PROCEDURE IF EXISTS h1;
-
-* Testcase 3.1.2.53 (4.11.42):
-* Ensure that a handler condition of sqlwarning takes the same action as a
-* handler condition defined with an sqlstate that begins with 01.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-CREATE PROCEDURE h1()
-BEGIN
-DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=1;
-insert into res_t1 values('xxx', 'yy');
-set @x=0;
-END//
-CALL h1();
-ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
-SELECT @done, @x;
-@done @x
-0 1
-CREATE TABLE res_t1(w CHAR, x CHAR);
-INSERT INTO res_t1 VALUES('a', 'b');
-INSERT INTO res_t1 VALUES('c', 'd');
-CALL h1();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-CREATE PROCEDURE h1()
-BEGIN
-DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=0;
-insert into res_t1 values('xxx', 'yy');
-set @x=1;
-END//
-CALL h1();
-ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
-SELECT @done, @x;
-@done @x
-0 0
-CREATE TABLE res_t1(w CHAR, x CHAR);
-INSERT INTO res_t1 VALUES('a', 'b');
-INSERT INTO res_t1 VALUES('c', 'd');
-CALL h1();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc.result b/mysql-test/suite/funcs_1/r/ndb_storedproc.result
deleted file mode 100644
index 04c1a45e67e..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc.result
+++ /dev/null
@@ -1,23607 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
-
-Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
-FUNCTION, ALTER PROCEDURE, ALTER FUNCTION, DROP PROCEDURE, DROP FUNCTION, SHOW
-CREATE PROCEDURE, SHOW CREATE FUNCTION, SHOW CREATE PROCEDURE STATUS, SHOW
-CREATE FUNCTION STATUS, and CALL statements:
---------------------------------------------------------------------------------
-
-Testcase 4.1.1:
----------------
-Ensure that all clauses that should be supported are supported
-CREATE PROCEDURE
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934 (f1 char(20) )
-SELECT * from t1 where f2 = f1;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934('aaaa');
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 tinytext ) language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1, @v1;
-END//
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 binary ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-3
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 blob ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-34
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 int ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 34 );
-@v1
-34
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 decimal(256, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-ERROR 42000: Too big precision 256 specified for column ''. Maximum is 65.
-DROP PROCEDURE IF EXISTS sp1//
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(66, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-ERROR 42000: Too big precision 66 specified for column ''. Maximum is 65.
-DROP PROCEDURE IF EXISTS sp1//
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(60, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set @v1 = f1;
-SELECT @v1;
-END//
-CALL sp1( 17976931340000 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.797693134e+13 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.7976931348623157493578e+308 );
-ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing
-CALL sp1( 0.1234567890987654321e+100 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-100 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+99 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-99 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+98 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-98 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+97 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-97 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+96 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-96 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+95 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-95 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+94 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-94 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+93 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-93 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+92 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-92 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+91 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-91 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+90 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-90 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+89 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-89 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+88 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-88 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+87 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-87 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+86 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-86 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+85 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-85 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+84 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-84 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+83 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-83 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+82 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-82 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+81 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-81 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+80 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-80 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+79 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-79 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+78 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-78 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+77 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-77 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+76 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-76 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+75 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-75 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+74 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-74 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+73 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-73 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+72 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-72 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+71 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-71 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+70 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-70 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+69 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-69 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+68 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-68 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+67 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-67 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+66 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-66 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+65 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-65 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+64 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-64 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+63 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-63 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+62 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-62 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+61 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-61 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+60 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-60 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+59 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-59 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+58 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-58 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+57 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-57 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+56 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-56 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+55 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-55 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+54 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-54 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+53 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-53 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+52 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-52 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+51 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-51 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+50 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-50 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+49 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-49 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+48 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-48 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+47 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-47 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+46 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-46 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+45 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-45 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+44 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-44 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+43 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-43 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+42 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-42 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+41 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-41 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+40 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-40 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+39 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-39 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+38 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-38 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+37 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-37 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+36 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-36 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+35 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-35 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+34 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-34 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+33 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-33 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+32 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-32 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+31 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-31 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+30 );
-@v1
-123456789098765400000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-30 );
-@v1
-0.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+29 );
-@v1
-12345678909876540000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-29 );
-@v1
-0.000000000000000000000000000001
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+28 );
-@v1
-1234567890987654000000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-28 );
-@v1
-0.000000000000000000000000000012
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+27 );
-@v1
-123456789098765400000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-27 );
-@v1
-0.000000000000000000000000000123
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+26 );
-@v1
-12345678909876540000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-26 );
-@v1
-0.000000000000000000000000001235
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+25 );
-@v1
-1234567890987654000000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-25 );
-@v1
-0.000000000000000000000000012346
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+24 );
-@v1
-123456789098765400000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-24 );
-@v1
-0.000000000000000000000000123457
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+23 );
-@v1
-12345678909876540000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-23 );
-@v1
-0.000000000000000000000001234568
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+22 );
-@v1
-1234567890987654000000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-22 );
-@v1
-0.000000000000000000000012345679
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+21 );
-@v1
-123456789098765400000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-21 );
-@v1
-0.000000000000000000000123456789
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+20 );
-@v1
-12345678909876540000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-20 );
-@v1
-0.000000000000000000001234567891
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+19 );
-@v1
-1234567890987654000.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-19 );
-@v1
-0.000000000000000000012345678910
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+18 );
-@v1
-123456789098765400.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-18 );
-@v1
-0.000000000000000000123456789099
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+17 );
-@v1
-12345678909876540.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-17 );
-@v1
-0.000000000000000001234567890988
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+16 );
-@v1
-1234567890987654.000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-16 );
-@v1
-0.000000000000000012345678909877
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+15 );
-@v1
-123456789098765.400000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-15 );
-@v1
-0.000000000000000123456789098765
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+14 );
-@v1
-12345678909876.540000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-14 );
-@v1
-0.000000000000001234567890987654
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+13 );
-@v1
-1234567890987.654000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-13 );
-@v1
-0.000000000000012345678909876540
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+12 );
-@v1
-123456789098.765400000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-12 );
-@v1
-0.000000000000123456789098765400
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+11 );
-@v1
-12345678909.876540000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-11 );
-@v1
-0.000000000001234567890987654000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+10 );
-@v1
-1234567890.987654000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-10 );
-@v1
-0.000000000012345678909876540000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+9 );
-@v1
-123456789.098765400000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-9 );
-@v1
-0.000000000123456789098765400000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+8 );
-@v1
-12345678.909876540000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-8 );
-@v1
-0.000000001234567890987654000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+7 );
-@v1
-1234567.890987654000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-7 );
-@v1
-0.000000012345678909876540000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+6 );
-@v1
-123456.789098765400000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-6 );
-@v1
-0.000000123456789098765400000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+5 );
-@v1
-12345.678909876540000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-5 );
-@v1
-0.000001234567890987654000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+4 );
-@v1
-1234.567890987654000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-4 );
-@v1
-0.000012345678909876550000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+3 );
-@v1
-123.456789098765400000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-3 );
-@v1
-0.000123456789098765400000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+2 );
-@v1
-12.345678909876540000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-2 );
-@v1
-0.001234567890987654000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+1 );
-@v1
-1.234567890987654000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-1 );
-@v1
-0.012345678909876540000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+0 );
-@v1
-0.123456789098765400000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-0 );
-@v1
-0.123456789098765400000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-CALL sp1( "value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 set("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-CALL sp1( "value1, value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-SELECT f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-CALL sp1( "value1" );
-f1
-value1
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) language sql SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) deterministic SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) not deterministic SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security definer SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security invoker SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) comment 'this is simple' SELECT f1;
-CALL sp1( 'abc' );
-f1
-abc
-SHOW PROCEDURE status like 'sp1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
-DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
-ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-DROP PROCEDURE sp1;
-
-Testcase 4.1.2:
----------------
-Ensure that all clauses that should be supported are supported
-CREATE FUNCTION
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
-SELECT fn1('world');
-fn1('world')
-hello, world!
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 mediumtext ) returns mediumtext language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = 'hello';
-set f1 = concat( @v1, f1 );
-return f1;
-END//
-SELECT fn1( ' world');
-fn1( ' world')
-hello world
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 decimal(63, 31) ) returns decimal(63, 31) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1000000 + f1;
-return f1;
-END//
-ERROR 42000: Too big scale 31 specified for column ''. Maximum is 30.
-SELECT fn1( 1.3326e+8 );
-ERROR 42000: FUNCTION db_storedproc.fn1 does not exist
-CREATE FUNCTION fn1( f1 decimal(63, 30) ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
-BEGIN
-set f1 = 1000000 + f1;
-return f1;
-END//
-SELECT fn1( 1.3326e+8 );
-fn1( 1.3326e+8 )
-134260000.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 enum("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in ENUM
-SELECT fn1( "value1" );
-fn1( "value1" )
-1.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 set("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
-END//
-Warnings:
-Note 1291 Column '' has duplicated value 'value1' in SET
-SELECT fn1( "value1, value1" );
-fn1( "value1, value1" )
-1.000000000000000000000000000000
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint deterministic
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint not deterministic
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security definer
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security invoker
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-comment 'this is simple'
-BEGIN
-set f1 = 1 + f1;
-return f1;
-END//
-SELECT fn1( 126 );
-fn1( 126 )
-127
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.1.3:
----------------
-Ensure that all clauses that should be supported are supported
-SHOW CREATE PROC
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (f1 char(20) )
-SELECT * from t1 where f2 = f1;
-show CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(f1 char(20) )
-SELECT * from t1 where f2 = f1 latin1 modified created
-DROP PROCEDURE sp1;
-
-Testcase 4.1.4:
----------------
-show create function
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
-show CREATE FUNCTION fn1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(s char(20)) RETURNS char(50) CHARSET latin1
-return concat('hello, ', s, '!') latin1 modified created
-DROP FUNCTION fn1;
-
-Testcase 4.1.5:
----------------
-SHOW PROCEDURE status
---------------------------------------------------------------------------------
-CREATE PROCEDURE sp5()
-SELECT * from t1;
-SHOW PROCEDURE status like 'sp5';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp5 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp5;
-
-Testcase 4.1.6:
----------------
-show function status
---------------------------------------------------------------------------------
-CREATE FUNCTION fn5(a int) returns int
-BEGIN
-set @b = 0.9 * a;
-return @b;
-END//
-SHOW FUNCTION STATUS LIKE 'fn5';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn5 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn5;
-
-Testcase 4.1.7:
----------------
-CALL procedure
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7a;
-DROP PROCEDURE IF EXISTS sp7b;
-DROP PROCEDURE IF EXISTS sp7c;
-CREATE PROCEDURE sp7a(a char(20))
-SELECT * from t1 where t1.f2 = a;
-CALL sp7a( 'xyz' );
-f1 f2 f3 f4 f5 f6
-CREATE PROCEDURE sp7b (a char (20), out b char(20))
-SELECT f1 into b from t1 where t1.f2= a;
-CALL sp7b('xyz', @out_param);
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
-SELECT @out_param;
-@out_param
-NULL
-CREATE PROCEDURE sp7c (a char (20), out b char(20), inout c int)
-BEGIN
-SELECT f1 into b from t1 where t1.f2=a;
-update t1 set t1.f2=999 where t1.f4=c;
-SELECT f2 into c from t1 where t1.f2=999;
-END//
-set @c=1;
-CALL sp7c('xyz', @out_param, @c);
-SELECT @out_param;
-@out_param
-NULL
-SELECT @c;
-@c
-1
-DROP PROCEDURE sp7a;
-DROP PROCEDURE sp7b;
-DROP PROCEDURE sp7c;
-
-Testcase 4.1.8:
----------------
-calling function
---------------------------------------------------------------------------------
-CREATE FUNCTION fn8(a char(20)) returns char(50)
-return concat('hello, ', a, '!');
-SELECT fn8('world');
-fn8('world')
-hello, world!
-DROP FUNCTION fn8;
-
-Testcase 4.1.9:
----------------
-drop procedure
---------------------------------------------------------------------------------
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-DROP PROCEDURE IF EXISTS sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE PROCEDURE sp9()SELECT * from t1;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
-DROP PROCEDURE sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE PROCEDURE sp9()SELECT * from t1;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
-DROP PROCEDURE IF EXISTS sp9;
-SELECT * from mysql.proc where specific_name='sp9';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.1.10:
-----------------
-DROP FUNCTION
---------------------------------------------------------------------------------
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-DROP FUNCTION IF EXISTS fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE FUNCTION fn10() returns int return 100;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100
-DROP FUNCTION fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-CREATE FUNCTION fn10() returns int return 100;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100
-DROP FUNCTION IF EXISTS fn10;
-SELECT * from mysql.proc where specific_name='fn10' and type='function';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.1.11:
-----------------
-alter proc
---------------------------------------------------------------------------------
-create user 'user_1'@'localhost';
-grant execute on db_storedproc.* to 'user_1'@'localhost';
-flush privileges;
-drop table IF EXISTS mysql.t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table mysql.t1( f1 char );
-DROP PROCEDURE IF EXISTS sp11;
-Warnings:
-Note 1305 PROCEDURE sp11 does not exist
-CREATE PROCEDURE sp11() insert into mysql.t1 values('a');
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-DEFINER
-connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
-
-user_1@localhost db_storedproc
-CALL sp11();
-USE db_storedproc;
-
-root@localhost db_storedproc
-alter procedure sp11 sql security invoker;
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-INVOKER
-
-user_1@localhost db_storedproc
-USE db_storedproc;
-CALL sp11();
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't1'
-commit work;
-
-root@localhost db_storedproc
-alter procedure sp11 sql security definer;
-SELECT security_type from mysql.proc where specific_name='sp11';
-security_type
-DEFINER
-CALL sp11();
-DROP USER 'user_1'@'localhost';
-DROP PROCEDURE sp11;
-drop table mysql.t1;
-
-Testcase 4.1.12:
-----------------
-alter function
---------------------------------------------------------------------------------
-CREATE FUNCTION fn12() returns int
-return 100;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-DEFINER
-SELECT fn12();
-fn12()
-100
-alter function fn12 sql security invoker;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-INVOKER
-SELECT fn12();
-fn12()
-100
-alter function fn12 sql security definer;
-SELECT security_type from mysql.proc where specific_name='fn12';
-security_type
-DEFINER
-SELECT fn12();
-fn12()
-100
-DROP FUNCTION fn12;
-
-Testcase 4.1.13:
-----------------
-alter proc
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp11;
-Warnings:
-Note 1305 PROCEDURE sp11 does not exist
-CREATE PROCEDURE sp11()
-SELECT * from t1;
-SELECT comment from mysql.proc where specific_name='sp11';
-comment
-
-alter procedure sp11 comment 'this is simple';
-SELECT comment from mysql.proc where specific_name='sp11';
-comment
-this is simple
-DROP PROCEDURE sp11;
-
-Testcase 4.1.14:
-----------------
-alter function
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn12;
-Warnings:
-Note 1305 FUNCTION fn12 does not exist
-CREATE FUNCTION fn12() returns int
-return 100;
-SELECT comment from mysql.proc where specific_name='fn12';
-comment
-
-alter function fn12 comment 'this is simple';
-SELECT comment from mysql.proc where specific_name='fn12';
-comment
-this is simple
-DROP FUNCTION fn12;
-
-Testcase 4.1.15:
-----------------
-Ensure that any invalid stored procedure name is never accepted, and that an
-appropriate error message is returned when the name is rejected
---------------------------------------------------------------------------------
-CREATE PROCEDURE sp1()
-DROP PROCEDURE sp1;
-ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
-CREATE PROCEDURE !_sp1( f1 char(20) )
-SELECT * from t1 where f2 = f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_sp1( f1 char(20) )
-SELECT * from t1 where f2 = f1' at line 1
-CREATE PROCEDURE function()
-SELECT * from t1 where f2=f1;
-DROP PROCEDURE function;
-CREATE PROCEDURE accessible()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE add()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE all()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE alter()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE analyze()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE and()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE as()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE asc()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE asensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE before()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE between()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE bigint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE binary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE blob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE both()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE by()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE call()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cascade()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE case()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE change()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE char()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE character()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE check()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE collate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE column()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE condition()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE constraint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE continue()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE convert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE create()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cross()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_date()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_time()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_timestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE current_user()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE cursor()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE database()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE databases()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_hour()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_minute()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE day_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE dec()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE decimal()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE declare()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE default()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE delayed()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE delete()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE desc()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE describe()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE deterministic()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE distinct()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE distinctrow()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE div()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE double()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE drop()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE dual()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE each()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE else()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE elseif()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE enclosed()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE escaped()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE exists()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE exit()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE explain()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE false()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fetch()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fields()
-SELECT * from t1 where f2=f1;
-DROP PROCEDURE fields;
-CREATE PROCEDURE float()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE for()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE force()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE foreign()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE from()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE fulltext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE grant()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE group()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE having()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE high_priority()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_minute()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE hour_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE if()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE ignore()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE in()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE index()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE infile()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE inner()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE inout()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE insensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE insert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int1()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int2()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int3()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int4()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE int8()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE integer()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE interval()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE into()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE is()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE iterate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE join()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE key()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE keys()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE kill()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE leading()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE leave()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE left()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE like()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE limit()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE linear()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE lines()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE load()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE localtime()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE localtimestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE lock()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE long()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE longblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE longtext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE loop()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE low_priority()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE master_ssl_verify_server_cert()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE match()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mediumtext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE middleint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE minute_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE minute_second()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE mod()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE modifies()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE natural()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE not()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE no_write_to_binlog()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE null()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE numeric()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE on()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE optimize()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE option()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE optionally()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE or()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE order()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE out()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE outer()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE outfile()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE precision()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE primary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE procedure()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE purge()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE range()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE read()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE reads()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE real()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE references()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE regexp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE release()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE rename()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE repeat()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE replace()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE require()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE restrict()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE return()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE revoke()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE right()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE rlike()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE schema()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE schemas()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE second_microsecond()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE select()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sensitive()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE separator()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE set()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE show()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE smallint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE spatial()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE specific()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlexception()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlstate()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sqlwarning()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_big_result()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_calc_found_rows()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE sql_small_result()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE ssl()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE starting()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE straight_join()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE table()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE terminated()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE then()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinyblob()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinyint()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE tinytext()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE to()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE trailing()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE trigger()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE true()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE undo()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE union()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unique()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unlock()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE unsigned()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE update()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE usage()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE use()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE using()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_date()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_time()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE utc_timestamp()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE values()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varbinary()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varchar()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varcharacter()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE varying()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE when()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE where()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE while()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE with()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE write()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE xor()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE year_month()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month()
-SELECT * from t1 where f2=f1' at line 1
-CREATE PROCEDURE zerofill()
-SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill()
-SELECT * from t1 where f2=f1' at line 1
-
-Testcase 4.1.15:
-----------------
-Ensure that any invalid function name is never accepted, and that an appropriate
-error message is returned when the name is rejected
---------------------------------------------------------------------------------
-CREATE FUNCTION !_fn1(f1 char) returns char
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_fn1(f1 char) returns char
-return f1' at line 1
-CREATE FUNCTION char(f1 char) returns char
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char(f1 char) returns char
-return f1' at line 1
-CREATE FUNCTION char binary(f1 char binary) returns char binary
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary(f1 char binary) returns char binary
-return f1' at line 1
-CREATE FUNCTION char ascii(f1 char ascii) returns char ascii
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii(f1 char ascii) returns char ascii
-return f1' at line 1
-CREATE FUNCTION char not null(f1 char not null) returns char not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char not null(f1 char not null) returns char not null
-return f1' at line 1
-CREATE FUNCTION char binary not null(f1 char binary not null) returns char binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary not null(f1 char binary not null) returns char binary not null
-retur' at line 1
-CREATE FUNCTION char ascii not null(f1 char ascii not null) returns char ascii not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii not null(f1 char ascii not null) returns char ascii not null
-return f' at line 1
-CREATE FUNCTION tinytext(f1 tinytext) returns tinytext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext(f1 tinytext) returns tinytext
-return f1' at line 1
-CREATE FUNCTION text(f1 text) returns text
-return f1;
-DROP FUNCTION text;
-CREATE FUNCTION mediumtext(f1 mediumtext) returns mediumtext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext(f1 mediumtext) returns mediumtext
-return f1' at line 1
-CREATE FUNCTION longtext(f1 longtext) returns longtext
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext(f1 longtext) returns longtext
-return f1' at line 1
-CREATE FUNCTION tinytext not null(f1 tinytext not null) returns tinytext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext not null(f1 tinytext not null) returns tinytext not null
-return f1' at line 1
-CREATE FUNCTION text not null(f1 text not null) returns text not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null(f1 text not null) returns text not null
-return f1' at line 1
-CREATE FUNCTION mediumtext not null(f1 mediumtext not null) returns mediumtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext not null(f1 mediumtext not null) returns mediumtext not null
-return f' at line 1
-CREATE FUNCTION longtext not null(f1 longtext not null) returns longtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext not null(f1 longtext not null) returns longtext not null
-return f1' at line 1
-CREATE FUNCTION tinyblob(f1 tinyblob) returns tinyblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob(f1 tinyblob) returns tinyblob
-return f1' at line 1
-CREATE FUNCTION blob(f1 blob) returns blob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob(f1 blob) returns blob
-return f1' at line 1
-CREATE FUNCTION mediumblob(f1 mediumblob) returns mediumblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob(f1 mediumblob) returns mediumblob
-return f1' at line 1
-CREATE FUNCTION longblob(f1 longblob) returns longblob
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob(f1 longblob) returns longblob
-return f1' at line 1
-CREATE FUNCTION tinyblob not null(f1 tinyblob not null) returns tinyblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob not null(f1 tinyblob not null) returns tinyblob not null
-return f1' at line 1
-CREATE FUNCTION blob not null(f1 blob not null) returns blob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob not null(f1 blob not null) returns blob not null
-return f1' at line 1
-CREATE FUNCTION mediumblob not null(f1 mediumblob not null) returns mediumblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob not null(f1 mediumblob not null) returns mediumblob not null
-return f' at line 1
-CREATE FUNCTION longblob not null(f1 longblob not null) returns longblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob not null(f1 longblob not null) returns longblob not null
-return f1' at line 1
-CREATE FUNCTION binary(f1 binary) returns binary
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary(f1 binary) returns binary
-return f1' at line 1
-CREATE FUNCTION binary not null(f1 binary not null) returns binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary not null(f1 binary not null) returns binary not null
-return f1' at line 1
-CREATE FUNCTION tinyint(f1 tinyint) returns tinyint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint(f1 tinyint) returns tinyint
-return f1' at line 1
-CREATE FUNCTION tinyint unsigned(f1 tinyint unsigned) returns tinyint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned(f1 tinyint unsigned) returns tinyint unsigned
-return f1' at line 1
-CREATE FUNCTION tinyint zerofill(f1 tinyint zerofill) returns tinyint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint zerofill(f1 tinyint zerofill) returns tinyint zerofill
-return f1' at line 1
-CREATE FUNCTION tinyint unsigned zerofill(f1 tinyint unsigned zerofill) returns tinyint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned zerofill(f1 tinyint unsigned zerofill) returns tinyint unsigned' at line 1
-CREATE FUNCTION smallint(f1 smallint) returns smallint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint(f1 smallint) returns smallint
-return f1' at line 1
-CREATE FUNCTION smallint unsigned(f1 smallint unsigned) returns smallint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned(f1 smallint unsigned) returns smallint unsigned
-return f1' at line 1
-CREATE FUNCTION smallint zerofill(f1 smallint zerofill) returns smallint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint zerofill(f1 smallint zerofill) returns smallint zerofill
-return f1' at line 1
-CREATE FUNCTION smallint unsigned zerofill(f1 smallint unsigned zerofill) returns smallint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned zerofill(f1 smallint unsigned zerofill) returns smallint unsig' at line 1
-CREATE FUNCTION mediumint(f1 mediumint) returns mediumint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint(f1 mediumint) returns mediumint
-return f1' at line 1
-CREATE FUNCTION mediumint unsigned(f1 mediumint unsigned) returns mediumint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned(f1 mediumint unsigned) returns mediumint unsigned
-return f1' at line 1
-CREATE FUNCTION mediumint zerofill(f1 mediumint zerofill) returns mediumint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint zerofill(f1 mediumint zerofill) returns mediumint zerofill
-return f1' at line 1
-CREATE FUNCTION mediumint unsigned zerofill(f1 mediumint unsigned zerofill) returns mediumint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned zerofill(f1 mediumint unsigned zerofill) returns mediumint un' at line 1
-CREATE FUNCTION int(f1 int) returns int
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int(f1 int) returns int
-return f1' at line 1
-CREATE FUNCTION int1(f1 int1) returns int1
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1(f1 int1) returns int1
-return f1' at line 1
-CREATE FUNCTION int2(f1 int2) returns int2
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2(f1 int2) returns int2
-return f1' at line 1
-CREATE FUNCTION int3(f1 int3) returns int3
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3(f1 int3) returns int3
-return f1' at line 1
-CREATE FUNCTION int4(f1 int4) returns int4
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4(f1 int4) returns int4
-return f1' at line 1
-CREATE FUNCTION int8(f1 int8) returns int8
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8(f1 int8) returns int8
-return f1' at line 1
-CREATE FUNCTION int unsigned(f1 int unsigned) returns int unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned(f1 int unsigned) returns int unsigned
-return f1' at line 1
-CREATE FUNCTION int zerofill(f1 int zerofill) returns int zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int zerofill(f1 int zerofill) returns int zerofill
-return f1' at line 1
-CREATE FUNCTION int unsigned zerofill(f1 int unsigned zerofill) returns int unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned zerofill(f1 int unsigned zerofill) returns int unsigned zerofill
-re' at line 1
-CREATE FUNCTION bigint(f1 bigint) returns bigint
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint(f1 bigint) returns bigint
-return f1' at line 1
-CREATE FUNCTION bigint unsigned(f1 bigint unsigned) returns bigint unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned(f1 bigint unsigned) returns bigint unsigned
-return f1' at line 1
-CREATE FUNCTION bigint zerofill(f1 bigint zerofill) returns bigint zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint zerofill(f1 bigint zerofill) returns bigint zerofill
-return f1' at line 1
-CREATE FUNCTION bigint unsigned zerofill(f1 bigint unsigned zerofill) returns bigint unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned zerofill(f1 bigint unsigned zerofill) returns bigint unsigned ze' at line 1
-CREATE FUNCTION decimal(f1 decimal) returns decimal
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal(f1 decimal) returns decimal
-return f1' at line 1
-CREATE FUNCTION decimal unsigned(f1 decimal unsigned) returns decimal unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned(f1 decimal unsigned) returns decimal unsigned
-return f1' at line 1
-CREATE FUNCTION decimal zerofill(f1 decimal zerofill) returns decimal zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal zerofill(f1 decimal zerofill) returns decimal zerofill
-return f1' at line 1
-CREATE FUNCTION decimal unsigned zerofill(f1 decimal unsigned zerofill) returns decimal unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned zerofill(f1 decimal unsigned zerofill) returns decimal unsigned' at line 1
-CREATE FUNCTION numeric(f1 numeric) returns numeric
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric(f1 numeric) returns numeric
-return f1' at line 1
-CREATE FUNCTION numeric unsigned(f1 numeric unsigned) returns numeric unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned(f1 numeric unsigned) returns numeric unsigned
-return f1' at line 1
-CREATE FUNCTION numeric zerofill(f1 numeric zerofill) returns numeric zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric zerofill(f1 numeric zerofill) returns numeric zerofill
-return f1' at line 1
-CREATE FUNCTION numeric unsigned zerofill(f1 numeric unsigned zerofill) returns numeric unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned zerofill(f1 numeric unsigned zerofill) returns numeric unsigned' at line 1
-CREATE FUNCTION real(f1 real) returns real
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real(f1 real) returns real
-return f1' at line 1
-CREATE FUNCTION real unsigned(f1 real unsigned) returns real unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned(f1 real unsigned) returns real unsigned
-return f1' at line 1
-CREATE FUNCTION real zerofill(f1 real zerofill) returns real zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real zerofill(f1 real zerofill) returns real zerofill
-return f1' at line 1
-CREATE FUNCTION real unsigned zerofill(f1 real unsigned zerofill) returns real unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned zerofill(f1 real unsigned zerofill) returns real unsigned zerofill' at line 1
-CREATE FUNCTION float(f1 float) returns float
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(f1 float) returns float
-return f1' at line 1
-CREATE FUNCTION float unsigned(f1 float unsigned) returns float unsigned
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned(f1 float unsigned) returns float unsigned
-return f1' at line 1
-CREATE FUNCTION float zerofill(f1 float zerofill) returns float zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float zerofill(f1 float zerofill) returns float zerofill
-return f1' at line 1
-CREATE FUNCTION float unsigned zerofill(f1 float unsigned zerofill) returns float unsigned zerofill
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned zerofill(f1 float unsigned zerofill) returns float unsigned zerof' at line 1
-CREATE FUNCTION date(f1 date) returns date
-return f1;
-DROP FUNCTION date;
-CREATE FUNCTION time(f1 time) returns time
-return f1;
-DROP FUNCTION time;
-CREATE FUNCTION datetime(f1 datetime) returns datetime
-return f1;
-DROP FUNCTION datetime;
-CREATE FUNCTION timestamp(f1 timestamp) returns timestamp
-return f1;
-DROP FUNCTION timestamp;
-CREATE FUNCTION year(f1 year) returns year
-return f1;
-DROP FUNCTION year;
-CREATE FUNCTION year(3)(f1 year(3)) returns year(3)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3)(f1 year(3)) returns year(3)
-return f1' at line 1
-CREATE FUNCTION year(4)(f1 year(4)) returns year(4)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4)(f1 year(4)) returns year(4)
-return f1' at line 1
-CREATE FUNCTION enum("1enum", "2enum")(f1 enum("1enum", "2enum")) returns enum("1enum", "2enum")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"1enum", "2enum")(f1 enum("1enum", "2enum")) returns enum("1enum", "2enum")
-retu' at line 1
-CREATE FUNCTION set("1set", "2set")(f1 set("1set", "2set")) returns set("1set", "2set")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set("1set", "2set")(f1 set("1set", "2set")) returns set("1set", "2set")
-return f' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ) returns char
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 char binary ) returns char binary
-return f1;
-ERROR 42000: This version of MySQL doesn't yet support 'return value collation'
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ascii ) returns char ascii
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 char not null ) returns char not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char binary not null ) returns char binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char binary not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 char ascii not null ) returns char ascii not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns char ascii not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinytext ) returns tinytext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 text ) returns text
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumtext ) returns mediumtext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 longtext ) returns longtext
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinytext not null ) returns tinytext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns tinytext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 text not null ) returns text not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns text not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 mediumtext not null ) returns mediumtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns mediumtext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 longtext not null ) returns longtext not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns longtext not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinyblob ) returns tinyblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 blob ) returns blob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumblob ) returns mediumblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 longblob ) returns longblob
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyblob not null ) returns tinyblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns tinyblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 blob not null ) returns blob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns blob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 mediumblob not null ) returns mediumblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns mediumblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 longblob not null ) returns longblob not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns longblob not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 binary ) returns binary
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 binary not null ) returns binary not null
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null ) returns binary not null
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 tinyint ) returns tinyint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint unsigned ) returns tinyint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint zerofill ) returns tinyint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 tinyint unsigned zerofill ) returns tinyint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint ) returns smallint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint unsigned ) returns smallint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint zerofill ) returns smallint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 smallint unsigned zerofill ) returns smallint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint ) returns mediumint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint unsigned ) returns mediumint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint zerofill ) returns mediumint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 mediumint unsigned zerofill ) returns mediumint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int ) returns int
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int unsigned ) returns int unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int1 unsigned ) returns int1 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int2 unsigned ) returns int2 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int3 unsigned ) returns int3 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int4 unsigned ) returns int4 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int8 unsigned ) returns int8 unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int zerofill ) returns int zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 int unsigned zerofill ) returns int unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint ) returns bigint
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint unsigned ) returns bigint unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint zerofill ) returns bigint zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 bigint unsigned zerofill ) returns bigint unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal ) returns decimal
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal unsigned ) returns decimal unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal zerofill ) returns decimal zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 decimal unsigned zerofill ) returns decimal unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric ) returns numeric
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric unsigned ) returns numeric unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric zerofill ) returns numeric zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 numeric unsigned zerofill ) returns numeric unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real ) returns real
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real unsigned ) returns real unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real zerofill ) returns real zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 real unsigned zerofill ) returns real unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float ) returns float
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float unsigned ) returns float unsigned
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float zerofill ) returns float zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 float unsigned zerofill ) returns float unsigned zerofill
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 date ) returns date
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 time ) returns time
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 datetime ) returns datetime
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 timestamp ) returns timestamp
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 year ) returns year
-return f1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(f1 year(f1 3) ) returns year(3)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 3) ) returns year(3)
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 year(f1 4) ) returns year(4)
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 4) ) returns year(4)
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 enum(f1 "1enum", "2enum") ) returns enum("1enum", "2enum")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 "1enum", "2enum") ) returns enum("1enum", "2enum")
-return f1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(f1 set(f1 "1set", "2set") ) returns set("1set", "2set")
-return f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f1 "1set", "2set") ) returns set("1set", "2set")
-return f1' at line 1
-
-Testcase 4.1.16:
-----------------
-Ensure that a reference to a non-existent stored procedure is rejected with an
-appropriate error message
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp16;
-Warnings:
-Note 1305 PROCEDURE sp16 does not exist
-CALL sp16( 'xyz' );
-ERROR 42000: PROCEDURE db_storedproc.sp16 does not exist
-CREATE DATABASE db1;
-USE db1;
-CREATE PROCEDURE sp16()
-BEGIN
-set @var1 = 1;
-SELECT @var1;
-END//
-CALL db_storedproc.sp16();
-ERROR 42000: PROCEDURE db_storedproc.sp16 does not exist
-USE db_storedproc;
-DROP PROCEDURE db1.sp16;
-DROP DATABASE db1;
-
-Testcase 4.1.17:
-----------------
-Ensure that it is possible to drop, create and CALL/execute a procedure and a
-function with the same name, even in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 ()
-BEGIN
-declare x enum( 'db1', 'test' ) default 'test';
-SELECT x;
-END//
-CALL sp1();
-x
-test
-CREATE FUNCTION sp1 (y char) returns char return y;
-SELECT sp1( 'a' );
-sp1( 'a' )
-a
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-USE db1;
-CALL db_storedproc.sp1( );
-x
-test
-SELECT db_storedproc.sp1( 'a' );
-db_storedproc.sp1( 'a' )
-a
-DROP FUNCTION db_storedproc.sp1;
-USE db_storedproc;
-SELECT sp1('a');
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-DROP PROCEDURE sp1;
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-SELECT sp1('a');
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-USE db_storedproc;
-DROP DATABASE db1;
-
-Testcase 4.1.18:
-----------------
-Ensure that it is possible to alter a procedure and
-a function with the same name, in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-set @x=null;
-set @y=null;
-CREATE PROCEDURE sp1()
-BEGIN
-set @x= 1;
-SELECT @x;
-END//
-CREATE FUNCTION sp1 () returns int return 2.2;
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-USE db1;
-alter procedure db_storedproc.sp1 sql security invoker;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION DEFINER
-sp1 PROCEDURE INVOKER
-alter function db_storedproc.sp1 sql security invoker;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION INVOKER
-sp1 PROCEDURE INVOKER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-USE db_storedproc;
-alter procedure sp1 sql security definer;
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-alter function sp1 sql security definer;
-SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-name type security_type
-sp1 FUNCTION DEFINER
-sp1 PROCEDURE DEFINER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-2
-USE db_storedproc;
-DROP DATABASE db1;
-DROP PROCEDURE db_storedproc.sp1;
-DROP FUNCTION db_storedproc.sp1;
-
-Testcase 4.1.19:
-----------------
-verify altering procedure and function with the same name, does not affect
-properties of a procedure and a function with the same name in the different
-database.
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc_3122;
-CREATE DATABASE db_storedproc_3122;
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-DROP PROCEDURE IF EXISTS db_storedproc_3122.sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-DROP FUNCTION IF EXISTS db_storedproc_3122.sp1;
-Warnings:
-Note 1305 FUNCTION sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-set @x= 1;
-SELECT @x;
-END//
-CREATE FUNCTION db_storedproc_3122.sp1() returns double return 2.2;
-CALL sp1();
-@x
-1
-SELECT db_storedproc_3122.sp1();
-db_storedproc_3122.sp1()
-2.2
-USE db_storedproc_3122;
-CREATE PROCEDURE sp1 ()
-BEGIN
-set @x= 3;
-SELECT @x;
-END//
-CREATE FUNCTION db_storedproc.sp1() returns double return 4.4;
-CALL sp1();
-@x
-3
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-4.4
-alter procedure db_storedproc_3122.sp1 sql security invoker;
-alter function sp1 sql security invoker;
-SELECT db, name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
-db name type security_type
-db_storedproc sp1 FUNCTION DEFINER
-db_storedproc sp1 PROCEDURE DEFINER
-db_storedproc_3122 sp1 FUNCTION INVOKER
-db_storedproc_3122 sp1 PROCEDURE INVOKER
-CALL db_storedproc.sp1();
-@x
-1
-SELECT db_storedproc.sp1();
-db_storedproc.sp1()
-4.4
-CALL db_storedproc_3122.sp1();
-@x
-3
-SELECT db_storedproc_3122.sp1();
-db_storedproc_3122.sp1()
-2.2
-USE db_storedproc;
-DROP DATABASE db_storedproc_3122;
-DROP FUNCTION db_storedproc.sp1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.20:
-----------------
-Ensure that it is possible to alter the comment of a procedure
-and a function with the same name, even in the same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-DROP PROCEDURE IF EXISTS sp1;
-DROP FUNCTION IF EXISTS sp1;
-CREATE PROCEDURE sp1 () set @x= 1;
-CREATE FUNCTION sp1 () returns int return 2;
-DROP DATABASE IF EXISTS db_storedproc_3122;
-Warnings:
-Note 1008 Can't drop database 'db_storedproc_3122'; database doesn't exist
-CREATE DATABASE db_storedproc_3122;
-USE db_storedproc_3122;
-CREATE PROCEDURE sp1 () set @x= 3;
-CREATE FUNCTION sp1 () returns int return 4;
-alter procedure sp1 sql security invoker comment 'this is a procedure';
-alter function sp1 sql security invoker comment 'this is a function';
-alter procedure sp1 sql security definer;
-alter function sp1 sql security definer;
-show CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
- COMMENT 'this is a procedure'
-set @x= 3 latin1 modified created
-show CREATE FUNCTION sp1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-sp1 CREATE DEFINER=`root`@`localhost` FUNCTION `sp1`() RETURNS int(11)
- COMMENT 'this is a function'
-return 4 latin1 modified created
-USE db_storedproc;
-DROP DATABASE db_storedproc_3122;
-DROP FUNCTION db_storedproc.sp1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.21:
-----------------
-Ensure that it is not possible to create two procedures with same name
-in same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 () set @x=1;
-CREATE PROCEDURE sp1 () set @x=2;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL sp1();
-SELECT @x;
-@x
-1
-USE db1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=3;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL db_storedproc.sp1();
-SELECT @x;
-@x
-1
-DROP PROCEDURE IF EXISTS db_storedproc.sp1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=1;
-CREATE PROCEDURE db_storedproc.sp1 () set @x=2;
-ERROR 42000: PROCEDURE sp1 already exists
-CALL db_storedproc.sp1();
-SELECT @x;
-@x
-1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.22:
-----------------
-Ensure that it is not possible to create two functions with same name in the
-same database
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP DATABASE IF EXISTS db1;
-Warnings:
-Note 1008 Can't drop database 'db1'; database doesn't exist
-CREATE DATABASE db1;
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1 () returns int return 1;
-CREATE FUNCTION fn1 () returns int return 2;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT fn1();
-fn1()
-1
-USE db1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 3;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT db_storedproc.fn1();
-db_storedproc.fn1()
-1
-DROP FUNCTION IF EXISTS db_storedproc.fn1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 1;
-CREATE FUNCTION db_storedproc.fn1 () returns int return 2;
-ERROR 42000: FUNCTION fn1 already exists
-SELECT db_storedproc.fn1();
-db_storedproc.fn1()
-1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP FUNCTION db_storedproc.fn1;
-
-Testcase 4.1.23:
-----------------
-Ensure that it is possible to create two or more procedures with the same name,
-providing each resides in different databases
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @x=null;
-set @y=null;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1 () set @x= 1;
-DROP DATABASE IF EXISTS test3124;
-Warnings:
-Note 1008 Can't drop database 'test3124'; database doesn't exist
-CREATE DATABASE test3124;
-USE test3124;
-CREATE PROCEDURE sp1 () set @y= 2;
-CALL sp1();
-SELECT @x, @y;
-@x @y
-NULL 2
-USE db_storedproc;
-CALL sp1();
-SELECT @x, @y;
-@x @y
-1 2
-USE db_storedproc;
-DROP DATABASE test3124;
-DROP PROCEDURE db_storedproc.sp1;
-
-Testcase 4.1.24:
-----------------
-Ensure that it is possible to create two or more functions with the same name,
-providing each resides in different databases.
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP FUNCTION IF EXISTS f1;
-Warnings:
-Note 1305 FUNCTION f1 does not exist
-CREATE FUNCTION f1 () returns int return 1;
-DROP DATABASE IF EXISTS test3125;
-Warnings:
-Note 1008 Can't drop database 'test3125'; database doesn't exist
-CREATE DATABASE test3125;
-USE test3125;
-CREATE FUNCTION f1 () returns int return 2;
-SELECT f1();
-f1()
-2
-USE db_storedproc;
-SELECT f1();
-f1()
-1
-USE db_storedproc;
-DROP DATABASE test3125;
-DROP FUNCTION db_storedproc.f1;
-
-Testcase 4.1.25:
-----------------
-Ensure that any invalid function name is never accepted, and that an appropriate
-error message is returned when the name is rejected. (invalid func name)
---------------------------------------------------------------------------------
-CREATE FUNCTION !_fn1( f1 char(20) ) returns int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!_fn1( f1 char(20) ) returns int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;' at line 1
-CREATE FUNCTION fn1( f1 char(20) ) return int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return int
-BEGIN
-SELECT * from t1 where f2 = f1;
-return 1;
-END' at line 1
-CREATE FUNCTION fn1() returns int
-return 'a';
-CREATE FUNCTION procedure() returns int
-return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure() returns int
-return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int lang sql return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int deterministic( return 1);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return 1)' at line 1
-CREATE FUNCTION fn1(a char) returns int non deterministic return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic return 1' at line 1
-CREATE FUNCTION fn1(a char) returns int not deterministic comment 'abc' language sql sql security refiner return 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'refiner return 1' at line 1
-DROP FUNCTION IF EXISTS fn1;
-
-Testcase 4.1.1:
----------------
-Ensure that all clauses that should be supported are supported.
-CREATE PROCEDURE
---------------------------------------------------------------------------------
-USE db_storedproc;
-set @count = 0;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1(cnt int(20))
-BEGIN
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-END//
-CALL sp1( 10 );
-SELECT @count;
-@count
-10
-DROP PROCEDURE sp1;
-
-Testcase 4.2.2:
-BEGINend
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-BEGIN
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-END//
-CALL sp1( 10 );
-@count
-10
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-END//
-ERROR 42S22: Unknown column 'cnt' in 'field list'
-CALL sp1( 10 );
-DROP PROCEDURE sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-END
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-BEGIN//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END
-SELECT count(*) into cnt from t2;
-set @count = cnt;
-SELECT @count;
-BEGIN' at line 2
-CALL sp1( 10 );
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( cnt int(20) )
-BEGIN
-SELECT count(*) into cnt from t2;
-BEGIN
-BEGIN END;
-BEGIN
-END;
-set @count = cnt;
-SELECT @count;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 10
-
-Testcase 4.2.4:
----------------
-Ensure that every BEGIN statement is coupled with a terminating END statement.
-(BEGIN with no END)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-
-Testcase ....:
---------------
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-accessible:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-add:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-all:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-alter:BEGIN
-SELECT @x;
-END//
-ERROR 0A000: ALTER VIEW is not allowed in stored procedures
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-analyze:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-and:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-as:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-asc:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-asensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-before:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-between:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-bigint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-binary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-blob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-both:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-by:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-call:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cascade:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-case:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-change:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-char:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-character:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-check:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-collate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-column:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-condition:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-constraint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-continue:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-convert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-create:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cross:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_date:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_time:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_timestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-current_user:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-cursor:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-database:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-databases:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_hour:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_minute:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-day_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-dec:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-decimal:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-declare:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-default:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-delayed:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-delete:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-desc:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-describe:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-deterministic:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-distinct:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-distinctrow:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-div:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-double:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-drop:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-dual:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-each:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-else:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-elseif:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-enclosed:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-escaped:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-exists:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-exit:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-explain:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-false:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-fetch:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float4:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-float8:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-for:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-force:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-foreign:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-from:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-fulltext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-grant:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-group:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-having:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-high_priority:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_minute:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-hour_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-if:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-ignore:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-in:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-index:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-infile:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-inner:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-inout:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-insensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-insert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int1:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int2:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int3:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int4:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-int8:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-integer:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-interval:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-into:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-is:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-iterate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-join:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-key:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-keys:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-kill:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-leading:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-leave:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-left:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-like:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-limit:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-linear:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-lines:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-load:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-localtime:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-localtimestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-lock:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-long:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-longblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-longtext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-loop:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-low_priority:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-master_ssl_verify_server_cert:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-match:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mediumtext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-middleint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-minute_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-minute_second:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-mod:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-modifies:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-natural:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-not:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-no_write_to_binlog:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-null:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-numeric:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-on:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-optimize:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-option:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-optionally:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-or:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-order:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-out:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-outer:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-outfile:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-precision:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-primary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-procedure:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-purge:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-range:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-read:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-reads:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-read_write:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-real:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-references:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-regexp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-release:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-rename:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-repeat:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-replace:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-require:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-restrict:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-return:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-revoke:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-right:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-rlike:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-schema:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-schemas:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-second_microsecond:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-select:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sensitive:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-separator:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-set:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-show:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-smallint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-spatial:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-specific:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlexception:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlstate:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sqlwarning:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_big_result:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_calc_found_rows:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-sql_small_result:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-ssl:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-starting:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-straight_join:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-table:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-terminated:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-then:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinyblob:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinyint:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-tinytext:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-to:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-trailing:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-trigger:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-true:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-undo:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-union:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unique:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unlock:BEGIN
-SELECT @x;
-END//
-ERROR 0A000: UNLOCK is not allowed in stored procedures
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-unsigned:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-update:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-usage:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-use:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-using:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_date:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_time:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-utc_timestamp:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-values:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varbinary:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varchar:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varcharacter:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-varying:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-when:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-where:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-while:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-with:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-write:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-xor:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-year_month:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month:BEGIN
-SELECT @x;
-END' at line 2
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-zerofill:BEGIN
-SELECT @x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill:BEGIN
-SELECT @x;
-END' at line 2
-
-Testcase 4.2.6:
----------------
-Ensure that the labels for multiple BEGIN an END work properly
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char;
-declare y char;
-set x = '1';
-set y = '2';
-label1: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END label1;
-set @v1 = x;
-set @v2 = y;
-SELECT @v1, @v2;
-END begin_label//
-CALL sp1();
-@v1 @v2
-1 2
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE sp1;
-
-Testcase 4.2.7:
----------------
-Ensure that the labels enclosing each BEGIN/END compound statement must match.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin1_label: BEGIN
-declare x char;
-declare y char;
-SELECT lf1, f1 into x, y from t2 limit 1;
-begin2_label: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin2_changed;
-END begin1_changed//
-ERROR 42000: End-label begin2_changed without match
-
-Testcase 4.2.8:
----------------
-Ensure that it is possible to put a beginning label at the start of a
-BEGIN/END compound statement without also requiring an ending label
-at the END of the same statement.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE sp1;
-
-Testcase 4.2.9:
----------------
-Ensure that it is not possible to put an ending label at the END of
-a BEGIN/END compound statement without also requiring a matching
-beginning label at the start of the same statement
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_label//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'begin_label' at line 6
-
-Testcase 4.2.10:
-----------------
-Ensure that every beginning label must END with a colon(:)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_label//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-E' at line 2
-
-Testcase 4.2.11:
-----------------
-Ensure that every beginning label with the same scope must be unique. (same label names)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_samelabel;
-begin_samelabel: BEGIN
-declare x char;
-declare y char;
-SELECT f1, f2 into x, y from t2 limit 1;
-END begin_samelabel;
-END begin_samelabel//
-ERROR 42000: Redefining label begin_samelabel
-
-Testcase 4.2.12:
-----------------
-Ensure that the variables, cursors, conditions, and handlers declared for
-a stored procedure (with the declare statement) may only be properly defined
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x char default 'a';
-declare y integer default 1;
-declare z float default 1.1;
-declare a enum("value1", "value2") default 'value1';
-declare b decimal(255, 255) default 1.2e+12;
-declare c mediumtext default 'mediumtext';
-declare d datetime default '2005-02-02 12:12:12';
-declare e char default 'b';
-declare cur1 cursor for SELECT f1 from db_storedproc.t2;
-declare continue handler for sqlstate '02000' set @x2 = 1;
-open cur1;
-fetch cur1 into e;
-SELECT x, y, z, a, b, c, d, e;
-close cur1;
-END//
-ERROR 42000: Too big scale 255 specified for column ''. Maximum is 30.
-CALL sp6();
-ERROR 42000: PROCEDURE db_storedproc.sp6 does not exist
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 char default '0';
-SELECT x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567;
-END//
-CALL sp6();
-x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
-0
-DROP PROCEDURE sp6;
-
-Testcase 4.2.13:
-----------------
-Ensure that the variables declared for a stored procedure (with the declare
-statement) may only be defined in the correct order.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x default '0' char;
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default '0' char;
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x char, integer default '0';
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' integer default '0';
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x1, x2 char, integer default '0', 1;
-SELECT x;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' integer default '0', 1;
-SELECT x;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x, y1 integer default 0;
-declare char y;
-SELECT f1, f2 into x, y from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x, y1 integer default 0;
-declare char y;
-SELECT f1, f2 into x, y from t2 li' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare x default 'a' char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default 'a' char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition notable for sqlstate '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition notable for sqlstate '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for notable sqlstate '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for notable sqlstate '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for sqlstate notable '42s22';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate notable '42s22';
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare condition for sqlstate '42s22' notable;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '42s22' notable;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor cur1 for SELECT f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor cur1 for SELECT f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor for cur1 SELECT f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor for cur1 SELECT f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor for SELECT cur1 f1 from db_storedproc.t2;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor for SELECT cur1 f1 from db_storedproc.t2;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler continue for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'continue for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler exit for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare handler undo for sqlstate '02000' set @x2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo for sqlstate '02000' set @x2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char x;
-SELECT f1 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char x;
-SELECT f1 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char binary x;
-SELECT f2 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char binary x;
-SELECT f2 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char ascii x;
-SELECT f3 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char ascii x;
-SELECT f3 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext x;
-SELECT f4 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext x;
-SELECT f4 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x;
-SELECT f5 text into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-SELECT f5 text into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext x;
-SELECT f6 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext x;
-SELECT f6 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext x;
-SELECT f7 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext x;
-SELECT f7 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob x;
-SELECT f8 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob x;
-SELECT f8 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob x;
-SELECT f9 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob x;
-SELECT f9 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob x;
-SELECT f10 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob x;
-SELECT f10 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob x;
-SELECT f11 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob x;
-SELECT f11 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary x;
-SELECT f12 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary x;
-SELECT f12 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint x;
-SELECT f13 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint x;
-SELECT f13 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint unsigned x;
-SELECT f14 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned x;
-SELECT f14 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint zerofill x;
-SELECT f15 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint zerofill x;
-SELECT f15 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint unsigned zerofill x;
-SELECT f16 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint unsigned zerofill x;
-SELECT f16 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint x;
-SELECT f17 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint x;
-SELECT f17 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint unsigned x;
-SELECT f18 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned x;
-SELECT f18 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint zerofill x;
-SELECT f19 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint zerofill x;
-SELECT f19 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint unsigned zerofill x;
-SELECT f20 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint unsigned zerofill x;
-SELECT f20 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint x;
-SELECT f21 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint x;
-SELECT f21 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint unsigned x;
-SELECT f22 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned x;
-SELECT f22 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint zerofill x;
-SELECT f23 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint zerofill x;
-SELECT f23 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint unsigned zerofill x;
-SELECT f24 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint unsigned zerofill x;
-SELECT f24 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int x;
-SELECT f25 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int x;
-SELECT f25 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int unsigned x;
-SELECT f26 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned x;
-SELECT f26 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int zerofill x;
-SELECT f27 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int zerofill x;
-SELECT f27 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int unsigned zerofill x;
-SELECT f28 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int unsigned zerofill x;
-SELECT f28 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint x;
-SELECT f29 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint x;
-SELECT f29 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint unsigned x;
-elect f30 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned x;
-elect f30 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint zerofill x;
-SELECT f31 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint zerofill x;
-SELECT f31 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint unsigned zerofill x;
-SELECT f32 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint unsigned zerofill x;
-SELECT f32 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal x;
-SELECT f33 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal x;
-SELECT f33 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal unsigned x;
-SELECT f34 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned x;
-SELECT f34 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal zerofill x;
-SELECT f35 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal zerofill x;
-SELECT f35 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal unsigned zerofill not null x;
-SELECT f36 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal unsigned zerofill not null x;
-SELECT f36 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) not null x;
-SELECT f37 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) not null x;
-SELECT f37 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) not null x;
-SELECT f38 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) not null x;
-SELECT f38 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) unsigned not null x;
-SELECT f39 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) unsigned not null x;
-SELECT f39 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) unsigned not null x;
-SELECT f40 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) unsigned not null x;
-SELECT f40 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) zerofill not null x;
-SELECT f41 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) zerofill not null x;
-SELECT f41 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) zerofill not null x;
-SELECT f42 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) zerofill not null x;
-SELECT f42 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (0) unsigned zerofill not null x;
-SELECT f43 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (0) unsigned zerofill not null x;
-SELECT f43 into x from tb1 limit 9998' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (64) unsigned zerofill not null x;
-SELECT f44 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (64) unsigned zerofill not null x;
-SELECT f44 into x from tb1 limit 999' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) not null x;
-SELECT f45 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) not null x;
-SELECT f45 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) not null x;
-SELECT f46 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) not null x;
-SELECT f46 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) unsigned not null x;
-SELECT f47 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) unsigned not null x;
-SELECT f47 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) unsigned not null x;
-SELECT f48 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) unsigned not null x;
-SELECT f48 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) zerofill not null x;
-SELECT f49 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) zerofill not null x;
-SELECT f49 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) zerofill not null x;
-SELECT f50 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) zerofill not null x;
-SELECT f50 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (00) unsigned zerofill not null x;
-SELECT f51 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (00) unsigned zerofill not null x;
-SELECT f51 into x from tb1 limit 999' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal (63, 30) unsigned zerofill not null x;
-SELECT f52 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal (63, 30) unsigned zerofill not null x;
-SELECT f52 into x from tb1 limit' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric not null x;
-SELECT f53 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric not null x;
-SELECT f53 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric unsigned not null x;
-SELECT f54 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned not null x;
-SELECT f54 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric zerofill not null x;
-SELECT f55 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric zerofill not null x;
-SELECT f55 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric unsigned zerofill not null x;
-SELECT f56 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric unsigned zerofill not null x;
-SELECT f56 into x from tb1 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) not null x;
-SELECT f57 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) not null x;
-SELECT f57 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) not nul x;
-SELECT f58 into x from tb1 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) not nul x;
-SELECT f58 into x from tb1 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) unsigned x;
-SELECT f59 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) unsigned x;
-SELECT f59 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) unsigned x;
-SELECT f60 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) unsigned x;
-SELECT f60 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) zerofill x;
-SELECT f61 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) zerofill x;
-SELECT f61 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) zerofill x;
-SELECT f62 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) zerofill x;
-SELECT f62 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (0) unsigned zerofill x;
-SELECT f63 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (0) unsigned zerofill x;
-SELECT f63 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (64) unsigned zerofill x;
-SELECT f64 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (64) unsigned zerofill x;
-SELECT f64 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) x;
-SELECT f65 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) x;
-SELECT f65 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) x;
-SELECT f66 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) x;
-SELECT f66 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) unsigned x;
-SELECT f67 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) unsigned x;
-SELECT f67 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) unsigned x;
-SELECT f68 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) unsigned x;
-SELECT f68 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) zerofill x;
-SELECT f69 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) zerofill x;
-SELECT f69 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) zerofill x;
-SELECT f70 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) zerofill x;
-SELECT f70 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (00) unsigned zerofill x;
-SELECT f71 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (00) unsigned zerofill x;
-SELECT f71 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric (63, 30) unsigned zerofill x;
-SELECT f72 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric (63, 30) unsigned zerofill x;
-SELECT f72 into x from tb2 limit 9998, 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real x;
-SELECT f73 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real x;
-SELECT f73 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real unsigned x;
-SELECT f74 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned x;
-SELECT f74 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real zerofill x;
-SELECT f75 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real zerofill x;
-SELECT f75 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real unsigned zerofill x;
-SELECT f76 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real unsigned zerofill x;
-SELECT f76 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double x;
-SELECT f77 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double x;
-SELECT f77 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double unsigned x;
-SELECT f78 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double unsigned x;
-SELECT f78 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double zerofill x;
-SELECT f79 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double zerofill x;
-SELECT f79 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double unsigned zerofill x;
-SELECT f80 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double unsigned zerofill x;
-SELECT f80 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float not null x;
-SELECT f81 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float not null x;
-SELECT f81 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float unsigned not null x;
-SELECT f82 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned not null x;
-SELECT f82 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float zerofill not null x;
-SELECT f83 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float zerofill not null x;
-SELECT f83 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float unsigned zerofill not null x;
-SELECT f84 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float unsigned zerofill not null x;
-SELECT f84 into x from tb2 limit 9998, 1;
-E' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) not null x;
-SELECT f85 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) not null x;
-SELECT f85 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) not null x;
-SELECT f86 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) not null x;
-SELECT f86 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) unsigned not null x;
-SELECT f87 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) unsigned not null x;
-SELECT f87 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) unsigned not null x;
-SELECT f88 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) unsigned not null x;
-SELECT f88 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) zerofill not null x;
-SELECT f89 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) zerofill not null x;
-SELECT f89 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) zerofill not null x;
-SELECT f90 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) zerofill not null x;
-SELECT f90 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(0) unsigned zerofill not null x;
-SELECT f91 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(0) unsigned zerofill not null x;
-SELECT f91 into x from tb2 limit 9998, 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(23) unsigned zerofill not null x;
-SELECT f92 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(23) unsigned zerofill not null x;
-SELECT f92 into x from tb2 limit 9998, ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) not null x;
-SELECT f93 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) not null x;
-SELECT f93 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) not null x;
-SELECT f94 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) not null x;
-SELECT f94 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) unsigned not null x;
-SELECT f95 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) unsigned not null x;
-SELECT f95 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) unsigned not null x;
-SELECT f96 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) unsigned not null x;
-SELECT f96 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) zerofill not null x;
-SELECT f97 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) zerofill not null x;
-SELECT f97 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) zerofill not null x;
-SELECT f98 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) zerofill not null x;
-SELECT f98 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(24) unsigned zerofill not null x;
-SELECT f99 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(24) unsigned zerofill not null x;
-SELECT f99 into x from tb2 limit 9998, ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float(53) unsigned zerofill not null x;
-SELECT f100 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float(53) unsigned zerofill not null x;
-SELECT f100 into x from tb2 limit 9998,' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare date not null x;
-SELECT f101 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f101 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare time not null x;
-SELECT f102 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f102 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare datetime not null x;
-SELECT f103 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f103 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare timestamp not null x;
-SELECT f104 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f104 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year not null x;
-SELECT f105 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null x;
-SELECT f105 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year(3) not null x;
-SELECT f106 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(3) not null x;
-SELECT f106 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year(4) not null x;
-SELECT f107 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(4) not null x;
-SELECT f107 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enum("1enum", "2enum") not null x;
-SELECT f108 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '("1enum", "2enum") not null x;
-SELECT f108 into x from tb2 limit 9998, 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set("1set", "2set") not nul x;
-SELECT f109 into x from tb2 limit 9998, 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set("1set", "2set") not nul x;
-SELECT f109 into x from tb2 limit 9998, 1;
-END' at line 3
-
-Testcase 4.2.14:
-----------------
-Ensure that the handlers declared for a stored procedure (with the declare
-statement) may only be defined in the correct order
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '23000' set @x2 = 1;
-declare x char;
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor1 cursor for SELECT f1 from tb1;
-declare x char;
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare cursor1 cursor for SELECT f1 from tb1;
-declare sqlcondition condition for sqlstate '02000';
-END//
-ERROR 42000: Variable or condition declaration after cursor or handler declaration
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare sqlcondition condition for sqlstate '02000';
-declare continue handler for sqlcondition set @x=1;
-declare cursor1 cursor for SELECT f1 from tb1;
-END//
-ERROR 42000: Cursor declaration after handler declaration
-
-Testcase 4.2.15:
-----------------
-Ensure that the declare statement can declare multiple variables both separately
-and all at once from a variable list. (multiple declaration)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-DECLARE x1 CHAR(100) DEFAULT 'outer';
-BEGIN
-DECLARE x1 CHAR(100) DEFAULT x1;
-END;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z char default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z char ascii default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinytext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z text default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumtext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z longtext default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z blob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z longblob default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z binary default null;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-NULL NULL NULL
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint default -126;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--126 -126 -126
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint unsigned default 253;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-253 253 253
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-000 000 000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z tinyint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-001 001 001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint default -32768;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--32768 -32768 -32768
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint unsigned default 65535;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-65535 65535 65535
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000 00000 00000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z smallint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00001 00001 00001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint default -8388608;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--8388608 -8388608 -8388608
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint unsigned default 16777215;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-16777215 16777215 16777215
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000 00000000 00000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z mediumint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001 00000001 00000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int default -2147483648;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--2147483648 -2147483648 -2147483648
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int unsigned default 4294967295;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-4294967295 4294967295 4294967295
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z int unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000001 0000000001 0000000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint default -9223372036854775808;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--9223372036854775808 -9223372036854775808 -9223372036854775808
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint unsigned default 18446744073709551615;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-18446744073709551615 18446744073709551615 18446744073709551615
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint zerofill default -1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000000000000000 00000000000000000000 00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z bigint unsigned zerofill default 1;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000000000000000001 00000000000000000001 00000000000000000001
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal default -34028234660123456789012345678901234567;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
--9999999999 -9999999999 -9999999999
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal zerofill default -34028234660123456789012345678901234567;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
-Warning 1264 Out of range value for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z decimal unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0 0 0
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z numeric unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-0000000000 0000000000 0000000000
-Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
-Note 1265 Data truncated for column 'z' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.175494351e-38 1.175494351e-38 1.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.175494351e-38 1.175494351e-38 1.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001.175494351e-38 00000001.175494351e-38 00000001.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z real unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-00000001.175494351e-38 00000001.175494351e-38 00000001.175494351e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.17549e-38 1.17549e-38 1.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float unsigned default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-1.17549e-38 1.17549e-38 1.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-01.17549e-38 01.17549e-38 01.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z float unsigned zerofill default 1.175494351e-38;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-01.17549e-38 01.17549e-38 01.17549e-38
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z date default '2005-02-02';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 2005-02-02 2005-02-02
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z time default '12:20:12';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-12:20:12 12:20:12 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z datetime default '2005-02-02 12:20:12';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 12:20:12 2005-02-02 12:20:12 2005-02-02 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z timestamp default '20050202122012';
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005-02-02 12:20:12 2005-02-02 12:20:12 2005-02-02 12:20:12
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year(3) default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z year(4) default 2005;
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2005 2005 2005
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z enum("1enum", "2enum") default "2enum";
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2enum 2enum 2enum
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x, y, z set("1set", "2set") default "2set";
-SELECT x, y, z;
-END//
-CALL sp1();
-x y z
-2set 2set 2set
-DROP PROCEDURE sp1;
-
-Testcase 4.2.16:
-----------------
-Ensure that the declare statement can declare multiple variables both separately
-and all at once from a variable list. (multiple declaration).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( )
-BEGIN
-declare a, b char default '2';
-declare c, d float default 1.3;
-declare e, f text default 'text';
-declare g, h enum("value1", "value2" ) default 'value1';
-declare i, j datetime default '2005-02-02 12:12:12';
-declare k, l blob default 'blob';
-SELECT a, b, c, d, e, f, g, h, k, l;
-END//
-CALL sp6();
-a b c d e f g h k l
-2 2 1.3 1.3 text text value1 value1 blob blob
-DROP PROCEDURE sp6;
-
-Testcase 4.2.17:
-----------------
-Ensure that the invalid variable declarations are rejected, with an appropriate
-error message.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare @x char;
-SELECT f2 into x from t2 limit 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@x char;
-SELECT f2 into x from t2 limit 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare accessible char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare add char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare all char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare alter char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare analyze char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare and char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare as char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare asc char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare asensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare before char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare between char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare bigint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare binary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare blob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare both char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare by char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare call char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cascade char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare case char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare change char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare char char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare character char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare check char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare collate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare column char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare condition char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare constraint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare convert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare create char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cross char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_date char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_time char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_timestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare current_user char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cursor char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare database char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare databases char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_hour char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_minute char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare day_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare dec char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare decimal char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare declare char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare default char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare delayed char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare delete char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare desc char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare describe char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare deterministic char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare distinct char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare distinctrow char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare div char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare double char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare drop char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare dual char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare each char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare else char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare elseif char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare enclosed char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare escaped char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare exists char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare exit char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare explain char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare false char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare fetch char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float4 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare float8 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare for char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare force char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare foreign char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare from char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare fulltext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare grant char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare group char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare having char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare high_priority char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_minute char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare hour_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare if char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare ignore char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare in char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare index char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare infile char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare inner char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare inout char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare insensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare insert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int1 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int2 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int3 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int4 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare int8 char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare integer char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare interval char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare into char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare is char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare iterate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare join char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare key char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare keys char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare kill char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare leading char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare leave char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare left char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare like char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare limit char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare linear char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare lines char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare load char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare localtime char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare localtimestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare lock char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare long char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare longblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare longtext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare loop char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare low_priority char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare master_ssl_verify_server_cert char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare match char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mediumtext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare middleint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare minute_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare minute_second char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare mod char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare modifies char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare natural char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare not char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare no_write_to_binlog char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare null char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare numeric char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare on char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare optimize char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare option char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare optionally char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare or char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare order char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare out char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare outer char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare outfile char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare precision char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare primary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare procedure char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare purge char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare range char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare reads char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read_only char;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare read_write char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare real char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare references char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare regexp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare release char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare rename char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare repeat char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare replace char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare require char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare restrict char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare return char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare revoke char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare right char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare rlike char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare schema char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare schemas char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare second_microsecond char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare SELECT char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sensitive char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare separator char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare set char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare show char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare smallint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare spatial char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare specific char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlexception char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlstate char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sqlwarning char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_big_result char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_calc_found_rows char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare sql_small_result char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare ssl char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare starting char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare straight_join char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare table char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare terminated char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare then char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinyblob char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinyint char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare tinytext char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare to char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare trailing char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare trigger char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare true char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare undo char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare union char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unique char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unlock char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare unsigned char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare update char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare usage char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare use char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare using char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_date char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_time char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare utc_timestamp char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare values char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varbinary char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varchar char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varcharacter char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare varying char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare when char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare where char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare while char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare with char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare write char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xor char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare year_month char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare zerofill char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill char;
-END' at line 3
-
-Testcase :
-----------
-Ensure that every possible type of condition may be declared for a stored procedure
-( covered in more detail in handlers section.)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'HY000';
-declare cond2 condition for sqlstate '23000';
-declare cond3 condition for sqlstate 'HY001';
-declare cond4 condition for sqlstate '08004';
-declare cond5 condition for sqlstate '08S01';
-declare cond6 condition for sqlstate '42000';
-declare cond7 condition for sqlstate '28000';
-declare cond8 condition for sqlstate '3D000';
-declare cond9 condition for sqlstate '42S01';
-declare cond10 condition for sqlstate '42S02';
-declare cond11 condition for sqlstate '42S22';
-declare cond12 condition for sqlstate '21S01';
-declare cond13 condition for sqlstate '42S21';
-declare cond14 condition for sqlstate '42S12';
-declare cond15 condition for sqlstate '22004';
-declare cond16 condition for sqlstate '25000';
-declare cond17 condition for sqlstate '40001';
-declare cond18 condition for sqlstate '21000';
-declare cond19 condition for sqlstate '01000';
-declare cond20 condition for sqlstate '22003';
-declare cond21 condition for sqlstate '22007';
-declare cond22 condition for sqlstate '0A000';
-declare cond23 condition for sqlstate '70100';
-declare cond24 condition for sqlstate '2F005';
-declare cond25 condition for sqlstate '24000';
-declare cond26 condition for sqlstate '02000';
-declare continue handler for cond2 set @x2 = 1;
-declare continue handler for cond1 set @x2 = 1;
-declare continue handler for cond3 set @x2 = 1;
-declare continue handler for cond4 set @x2 = 1;
-declare continue handler for cond5 set @x2 = 1;
-declare continue handler for cond7 set @x2 = 1;
-declare continue handler for cond6 set @x2 = 1;
-declare continue handler for cond8 set @x2 = 1;
-declare continue handler for cond9 set @x2 = 1;
-declare continue handler for cond10 set @x2 = 1;
-declare continue handler for cond11 set @x2 = 1;
-declare continue handler for cond12 set @x2 = 1;
-declare continue handler for cond13 set @x2 = 1;
-declare continue handler for cond14 set @x2 = 1;
-declare continue handler for cond15 set @x2 = 1;
-declare continue handler for cond16 set @x2 = 1;
-declare continue handler for cond17 set @x2 = 1;
-declare continue handler for cond18 set @x2 = 1;
-declare continue handler for cond19 set @x2 = 1;
-declare continue handler for cond20 set @x2 = 1;
-declare continue handler for cond21 set @x2 = 1;
-declare continue handler for cond22 set @x2 = 1;
-declare continue handler for cond23 set @x2 = 1;
-declare continue handler for cond24 set @x2 = 1;
-declare continue handler for cond25 set @x2 = 1;
-declare continue handler for cond26 set @x2 = 1;
-set @x = 1;
-insert into t2 values (1);
-set @x = 2;
-insert into t2 values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare @x char;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@x char;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x char1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare accessible condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible condition for sqlstate '02000';
-declare exit handler for add set @var' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare add condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare all condition for sqlstate '02000';
-declare exit handler for all set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all condition for sqlstate '02000';
-declare exit handler for all set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare alter condition for sqlstate '02000';
-declare exit handler for alter set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter condition for sqlstate '02000';
-declare exit handler for alter set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare analyze condition for sqlstate '02000';
-declare exit handler for analyze set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze condition for sqlstate '02000';
-declare exit handler for analyze set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare and condition for sqlstate '02000';
-declare exit handler for and set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and condition for sqlstate '02000';
-declare exit handler for and set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare as condition for sqlstate '02000';
-declare exit handler for as set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as condition for sqlstate '02000';
-declare exit handler for as set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asc condition for sqlstate '02000';
-declare exit handler for asc set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc condition for sqlstate '02000';
-declare exit handler for asc set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asensitive condition for sqlstate '02000';
-declare exit handler for asensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive condition for sqlstate '02000';
-declare exit handler for asensitive s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare before condition for sqlstate '02000';
-declare exit handler for before set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before condition for sqlstate '02000';
-declare exit handler for before set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare between condition for sqlstate '02000';
-declare exit handler for between set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between condition for sqlstate '02000';
-declare exit handler for between set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint condition for sqlstate '02000';
-declare exit handler for bigint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint condition for sqlstate '02000';
-declare exit handler for bigint set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary condition for sqlstate '02000';
-declare exit handler for binary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary condition for sqlstate '02000';
-declare exit handler for binary set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob condition for sqlstate '02000';
-declare exit handler for blob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob condition for sqlstate '02000';
-declare exit handler for blob set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare both condition for sqlstate '02000';
-declare exit handler for both set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both condition for sqlstate '02000';
-declare exit handler for both set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare by condition for sqlstate '02000';
-declare exit handler for by set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by condition for sqlstate '02000';
-declare exit handler for by set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare call condition for sqlstate '02000';
-declare exit handler for CALL set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call condition for sqlstate '02000';
-declare exit handler for CALL set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cascade condition for sqlstate '02000';
-declare exit handler for cascade set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade condition for sqlstate '02000';
-declare exit handler for cascade set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare case condition for sqlstate '02000';
-declare exit handler for case set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case condition for sqlstate '02000';
-declare exit handler for case set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare change condition for sqlstate '02000';
-declare exit handler for change set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change condition for sqlstate '02000';
-declare exit handler for change set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char condition for sqlstate '02000';
-declare exit handler for char set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char condition for sqlstate '02000';
-declare exit handler for char set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare character condition for sqlstate '02000';
-declare exit handler for character set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character condition for sqlstate '02000';
-declare exit handler for character set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare check condition for sqlstate '02000';
-declare exit handler for check set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check condition for sqlstate '02000';
-declare exit handler for check set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare collate condition for sqlstate '02000';
-declare exit handler for collate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate condition for sqlstate '02000';
-declare exit handler for collate set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare column condition for sqlstate '02000';
-declare exit handler for column set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column condition for sqlstate '02000';
-declare exit handler for column set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare condition condition for sqlstate '02000';
-declare exit handler for condition set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition condition for sqlstate '02000';
-declare exit handler for condition set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare connection condition for sqlstate '02000';
-declare exit handler for connection set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare constraint condition for sqlstate '02000';
-declare exit handler for constraint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint condition for sqlstate '02000';
-declare exit handler for constraint s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare continue condition for sqlstate '02000';
-declare exit handler for continue set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for continue set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare convert condition for sqlstate '02000';
-declare exit handler for convert set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert condition for sqlstate '02000';
-declare exit handler for convert set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare create condition for sqlstate '02000';
-declare exit handler for create set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create condition for sqlstate '02000';
-declare exit handler for create set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cross condition for sqlstate '02000';
-declare exit handler for cross set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross condition for sqlstate '02000';
-declare exit handler for cross set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_date condition for sqlstate '02000';
-declare exit handler for current_date set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date condition for sqlstate '02000';
-declare exit handler for current_da' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_time condition for sqlstate '02000';
-declare exit handler for current_time set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time condition for sqlstate '02000';
-declare exit handler for current_ti' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_timestamp condition for sqlstate '02000';
-declare exit handler for current_timestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp condition for sqlstate '02000';
-declare exit handler for curre' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_user condition for sqlstate '02000';
-declare exit handler for current_user set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user condition for sqlstate '02000';
-declare exit handler for current_us' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cursor condition for sqlstate '02000';
-declare exit handler for cursor set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor condition for sqlstate '02000';
-declare exit handler for cursor set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare database condition for sqlstate '02000';
-declare exit handler for database set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database condition for sqlstate '02000';
-declare exit handler for database set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare databases condition for sqlstate '02000';
-declare exit handler for databases set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases condition for sqlstate '02000';
-declare exit handler for databases set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_hour condition for sqlstate '02000';
-declare exit handler for day_hour set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour condition for sqlstate '02000';
-declare exit handler for day_hour set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_microsecond condition for sqlstate '02000';
-declare exit handler for day_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond condition for sqlstate '02000';
-declare exit handler for day_mic' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_minute condition for sqlstate '02000';
-declare exit handler for day_minute set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute condition for sqlstate '02000';
-declare exit handler for day_minute s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_second condition for sqlstate '02000';
-declare exit handler for day_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second condition for sqlstate '02000';
-declare exit handler for day_second s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dec condition for sqlstate '02000';
-declare exit handler for dec set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec condition for sqlstate '02000';
-declare exit handler for dec set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal condition for sqlstate '02000';
-declare exit handler for decimal set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal condition for sqlstate '02000';
-declare exit handler for decimal set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare declare condition for sqlstate '02000';
-declare exit handler for declare set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare condition for sqlstate '02000';
-declare exit handler for declare set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare default condition for sqlstate '02000';
-declare exit handler for default set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default condition for sqlstate '02000';
-declare exit handler for default set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delayed condition for sqlstate '02000';
-declare exit handler for delayed set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed condition for sqlstate '02000';
-declare exit handler for delayed set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delete condition for sqlstate '02000';
-declare exit handler for delete set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete condition for sqlstate '02000';
-declare exit handler for delete set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare desc condition for sqlstate '02000';
-declare exit handler for desc set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc condition for sqlstate '02000';
-declare exit handler for desc set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare describe condition for sqlstate '02000';
-declare exit handler for describe set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe condition for sqlstate '02000';
-declare exit handler for describe set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare deterministic condition for sqlstate '02000';
-declare exit handler for deterministic set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic condition for sqlstate '02000';
-declare exit handler for determini' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinct condition for sqlstate '02000';
-declare exit handler for distinct set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct condition for sqlstate '02000';
-declare exit handler for distinct set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinctrow condition for sqlstate '02000';
-declare exit handler for distinctrow set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow condition for sqlstate '02000';
-declare exit handler for distinctrow' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare div condition for sqlstate '02000';
-declare exit handler for div set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div condition for sqlstate '02000';
-declare exit handler for div set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double condition for sqlstate '02000';
-declare exit handler for double set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double condition for sqlstate '02000';
-declare exit handler for double set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare drop condition for sqlstate '02000';
-declare exit handler for drop set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop condition for sqlstate '02000';
-declare exit handler for drop set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dual condition for sqlstate '02000';
-declare exit handler for dual set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual condition for sqlstate '02000';
-declare exit handler for dual set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare each condition for sqlstate '02000';
-declare exit handler for each set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each condition for sqlstate '02000';
-declare exit handler for each set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare else condition for sqlstate '02000';
-declare exit handler for else set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else condition for sqlstate '02000';
-declare exit handler for else set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare elseif condition for sqlstate '02000';
-declare exit handler for elseif set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif condition for sqlstate '02000';
-declare exit handler for elseif set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enclosed condition for sqlstate '02000';
-declare exit handler for enclosed set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed condition for sqlstate '02000';
-declare exit handler for enclosed set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare escaped condition for sqlstate '02000';
-declare exit handler for escaped set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped condition for sqlstate '02000';
-declare exit handler for escaped set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exists condition for sqlstate '02000';
-declare exit handler for exists set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists condition for sqlstate '02000';
-declare exit handler for exists set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exit condition for sqlstate '02000';
-declare exit handler for exit set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for exit set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare explain condition for sqlstate '02000';
-declare exit handler for explain set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain condition for sqlstate '02000';
-declare exit handler for explain set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare false condition for sqlstate '02000';
-declare exit handler for false set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false condition for sqlstate '02000';
-declare exit handler for false set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fetch condition for sqlstate '02000';
-declare exit handler for fetch set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch condition for sqlstate '02000';
-declare exit handler for fetch set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float condition for sqlstate '02000';
-declare exit handler for float set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float condition for sqlstate '02000';
-declare exit handler for float set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float4 condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 condition for sqlstate '02000';
-declare exit handler for add set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float8 condition for sqlstate '02000';
-declare exit handler for add set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 condition for sqlstate '02000';
-declare exit handler for add set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare for condition for sqlstate '02000';
-declare exit handler for for set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for condition for sqlstate '02000';
-declare exit handler for for set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare force condition for sqlstate '02000';
-declare exit handler for force set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force condition for sqlstate '02000';
-declare exit handler for force set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare foreign condition for sqlstate '02000';
-declare exit handler for foreign set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign condition for sqlstate '02000';
-declare exit handler for foreign set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare from condition for sqlstate '02000';
-declare exit handler for from set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from condition for sqlstate '02000';
-declare exit handler for from set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fulltext condition for sqlstate '02000';
-declare exit handler for fulltext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext condition for sqlstate '02000';
-declare exit handler for fulltext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare grant condition for sqlstate '02000';
-declare exit handler for grant set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant condition for sqlstate '02000';
-declare exit handler for grant set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare group condition for sqlstate '02000';
-declare exit handler for group set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group condition for sqlstate '02000';
-declare exit handler for group set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare having condition for sqlstate '02000';
-declare exit handler for having set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having condition for sqlstate '02000';
-declare exit handler for having set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare high_priority condition for sqlstate '02000';
-declare exit handler for high_priority set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority condition for sqlstate '02000';
-declare exit handler for high_prio' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_microsecond condition for sqlstate '02000';
-declare exit handler for hour_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond condition for sqlstate '02000';
-declare exit handler for hour_m' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_minute condition for sqlstate '02000';
-declare exit handler for hour_minute set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute condition for sqlstate '02000';
-declare exit handler for hour_minute' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_second condition for sqlstate '02000';
-declare exit handler for hour_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second condition for sqlstate '02000';
-declare exit handler for hour_second' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare if condition for sqlstate '02000';
-declare exit handler for if set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if condition for sqlstate '02000';
-declare exit handler for if set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ignore condition for sqlstate '02000';
-declare exit handler for ignore set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore condition for sqlstate '02000';
-declare exit handler for ignore set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare in condition for sqlstate '02000';
-declare exit handler for in set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in condition for sqlstate '02000';
-declare exit handler for in set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare index condition for sqlstate '02000';
-declare exit handler for index set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index condition for sqlstate '02000';
-declare exit handler for index set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare infile condition for sqlstate '02000';
-declare exit handler for infile set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile condition for sqlstate '02000';
-declare exit handler for infile set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inner condition for sqlstate '02000';
-declare exit handler for inner set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner condition for sqlstate '02000';
-declare exit handler for inner set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inout condition for sqlstate '02000';
-declare exit handler for inout set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout condition for sqlstate '02000';
-declare exit handler for inout set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insensitive condition for sqlstate '02000';
-declare exit handler for insensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive condition for sqlstate '02000';
-declare exit handler for insensitive' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insert condition for sqlstate '02000';
-declare exit handler for insert set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert condition for sqlstate '02000';
-declare exit handler for insert set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int1 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int2 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int3 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int4 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int8 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare integer condition for sqlstate '02000';
-declare exit handler for integer set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer condition for sqlstate '02000';
-declare exit handler for integer set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare interval condition for sqlstate '02000';
-declare exit handler for interval set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval condition for sqlstate '02000';
-declare exit handler for interval set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare into condition for sqlstate '02000';
-declare exit handler for into set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into condition for sqlstate '02000';
-declare exit handler for into set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare is condition for sqlstate '02000';
-declare exit handler for is set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is condition for sqlstate '02000';
-declare exit handler for is set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare iterate condition for sqlstate '02000';
-declare exit handler for iterate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate condition for sqlstate '02000';
-declare exit handler for iterate set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare join condition for sqlstate '02000';
-declare exit handler for join set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join condition for sqlstate '02000';
-declare exit handler for join set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare key condition for sqlstate '02000';
-declare exit handler for key set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key condition for sqlstate '02000';
-declare exit handler for key set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare keys condition for sqlstate '02000';
-declare exit handler for keys set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys condition for sqlstate '02000';
-declare exit handler for keys set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare kill condition for sqlstate '02000';
-declare exit handler for kill set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill condition for sqlstate '02000';
-declare exit handler for kill set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leading condition for sqlstate '02000';
-declare exit handler for leading set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading condition for sqlstate '02000';
-declare exit handler for leading set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leave condition for sqlstate '02000';
-declare exit handler for leave set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave condition for sqlstate '02000';
-declare exit handler for leave set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare left condition for sqlstate '02000';
-declare exit handler for left set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left condition for sqlstate '02000';
-declare exit handler for left set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare like condition for sqlstate '02000';
-declare exit handler for like set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like condition for sqlstate '02000';
-declare exit handler for like set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare limit condition for sqlstate '02000';
-declare exit handler for limit set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit condition for sqlstate '02000';
-declare exit handler for limit set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare linear condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear condition for sqlstate '02000';
-declare exit handler for int set @var2 = ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lines condition for sqlstate '02000';
-declare exit handler for lines set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines condition for sqlstate '02000';
-declare exit handler for lines set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare load condition for sqlstate '02000';
-declare exit handler for load set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load condition for sqlstate '02000';
-declare exit handler for load set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtime condition for sqlstate '02000';
-declare exit handler for localtime set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime condition for sqlstate '02000';
-declare exit handler for localtime set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtimestamp condition for sqlstate '02000';
-declare exit handler for localtimestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp condition for sqlstate '02000';
-declare exit handler for localtim' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lock condition for sqlstate '02000';
-declare exit handler for lock set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock condition for sqlstate '02000';
-declare exit handler for lock set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare long condition for sqlstate '02000';
-declare exit handler for long set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long condition for sqlstate '02000';
-declare exit handler for long set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob condition for sqlstate '02000';
-declare exit handler for longblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob condition for sqlstate '02000';
-declare exit handler for longblob set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext condition for sqlstate '02000';
-declare exit handler for longtext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext condition for sqlstate '02000';
-declare exit handler for longtext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare loop condition for sqlstate '02000';
-declare exit handler for loop set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop condition for sqlstate '02000';
-declare exit handler for loop set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare low_priority condition for sqlstate '02000';
-declare exit handler for low_priority set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority condition for sqlstate '02000';
-declare exit handler for low_priori' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare master_ssl_verify_server_cert condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert condition for sqlstate '02000';
-declare exit handl' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare match condition for sqlstate '02000';
-declare exit handler for match set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match condition for sqlstate '02000';
-declare exit handler for match set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob condition for sqlstate '02000';
-declare exit handler for mediumblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob condition for sqlstate '02000';
-declare exit handler for mediumblob s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint condition for sqlstate '02000';
-declare exit handler for mediumint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint condition for sqlstate '02000';
-declare exit handler for mediumint set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext condition for sqlstate '02000';
-declare exit handler for mediumtext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext condition for sqlstate '02000';
-declare exit handler for mediumtext s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare middleint condition for sqlstate '02000';
-declare exit handler for middleint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint condition for sqlstate '02000';
-declare exit handler for middleint set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_microsecond condition for sqlstate '02000';
-declare exit handler for minute_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond condition for sqlstate '02000';
-declare exit handler for minu' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_second condition for sqlstate '02000';
-declare exit handler for minute_second set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second condition for sqlstate '02000';
-declare exit handler for minute_se' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mod condition for sqlstate '02000';
-declare exit handler for mod set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod condition for sqlstate '02000';
-declare exit handler for mod set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare modifies condition for sqlstate '02000';
-declare exit handler for modifies set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies condition for sqlstate '02000';
-declare exit handler for modifies set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare natural condition for sqlstate '02000';
-declare exit handler for natural set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural condition for sqlstate '02000';
-declare exit handler for natural set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare not condition for sqlstate '02000';
-declare exit handler for not set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not condition for sqlstate '02000';
-declare exit handler for not set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare no_write_to_binlog condition for sqlstate '02000';
-declare exit handler for no_write_to_binlog set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog condition for sqlstate '02000';
-declare exit handler for no_w' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare null condition for sqlstate '02000';
-declare exit handler for null set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null condition for sqlstate '02000';
-declare exit handler for null set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric condition for sqlstate '02000';
-declare exit handler for numeric set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric condition for sqlstate '02000';
-declare exit handler for numeric set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare on condition for sqlstate '02000';
-declare exit handler for on set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on condition for sqlstate '02000';
-declare exit handler for on set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optimize condition for sqlstate '02000';
-declare exit handler for optimize set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize condition for sqlstate '02000';
-declare exit handler for optimize set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare option condition for sqlstate '02000';
-declare exit handler for option set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option condition for sqlstate '02000';
-declare exit handler for option set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optionally condition for sqlstate '02000';
-declare exit handler for optionally set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally condition for sqlstate '02000';
-declare exit handler for optionally s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare or condition for sqlstate '02000';
-declare exit handler for or set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or condition for sqlstate '02000';
-declare exit handler for or set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare order condition for sqlstate '02000';
-declare exit handler for order set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order condition for sqlstate '02000';
-declare exit handler for order set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare out condition for sqlstate '02000';
-declare exit handler for out set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out condition for sqlstate '02000';
-declare exit handler for out set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outer condition for sqlstate '02000';
-declare exit handler for outer set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer condition for sqlstate '02000';
-declare exit handler for outer set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outfile condition for sqlstate '02000';
-declare exit handler for outfile set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile condition for sqlstate '02000';
-declare exit handler for outfile set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare precision condition for sqlstate '02000';
-declare exit handler for precision set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision condition for sqlstate '02000';
-declare exit handler for precision set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare primary condition for sqlstate '02000';
-declare exit handler for primary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary condition for sqlstate '02000';
-declare exit handler for primary set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare procedure condition for sqlstate '02000';
-declare exit handler for procedure set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure condition for sqlstate '02000';
-declare exit handler for procedure set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare purge condition for sqlstate '02000';
-declare exit handler for purge set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge condition for sqlstate '02000';
-declare exit handler for purge set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare range condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read condition for sqlstate '02000';
-declare exit handler for read set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read condition for sqlstate '02000';
-declare exit handler for read set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare reads condition for sqlstate '02000';
-declare exit handler for reads set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads condition for sqlstate '02000';
-declare exit handler for reads set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_only condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int set @var2 = 1;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_write condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write condition for sqlstate '02000';
-declare exit handler for int set @var' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real condition for sqlstate '02000';
-declare exit handler for real set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real condition for sqlstate '02000';
-declare exit handler for real set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare references condition for sqlstate '02000';
-declare exit handler for references set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references condition for sqlstate '02000';
-declare exit handler for references s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare regexp condition for sqlstate '02000';
-declare exit handler for regexp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp condition for sqlstate '02000';
-declare exit handler for regexp set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare release condition for sqlstate '02000';
-declare exit handler for int set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release condition for sqlstate '02000';
-declare exit handler for int set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rename condition for sqlstate '02000';
-declare exit handler for rename set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename condition for sqlstate '02000';
-declare exit handler for rename set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare repeat condition for sqlstate '02000';
-declare exit handler for repeat set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat condition for sqlstate '02000';
-declare exit handler for repeat set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare replace condition for sqlstate '02000';
-declare exit handler for replace set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace condition for sqlstate '02000';
-declare exit handler for replace set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare require condition for sqlstate '02000';
-declare exit handler for require set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require condition for sqlstate '02000';
-declare exit handler for require set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare restrict condition for sqlstate '02000';
-declare exit handler for restrict set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict condition for sqlstate '02000';
-declare exit handler for restrict set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare return condition for sqlstate '02000';
-declare exit handler for return set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return condition for sqlstate '02000';
-declare exit handler for return set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare revoke condition for sqlstate '02000';
-declare exit handler for revoke set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke condition for sqlstate '02000';
-declare exit handler for revoke set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare right condition for sqlstate '02000';
-declare exit handler for right set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right condition for sqlstate '02000';
-declare exit handler for right set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rlike condition for sqlstate '02000';
-declare exit handler for rlike set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike condition for sqlstate '02000';
-declare exit handler for rlike set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schema condition for sqlstate '02000';
-declare exit handler for schema set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema condition for sqlstate '02000';
-declare exit handler for schema set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schemas condition for sqlstate '02000';
-declare exit handler for schemas set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas condition for sqlstate '02000';
-declare exit handler for schemas set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare second_microsecond condition for sqlstate '02000';
-declare exit handler for second_microsecond set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond condition for sqlstate '02000';
-declare exit handler for seco' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare select condition for sqlstate '02000';
-declare exit handler for SELECT set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select condition for sqlstate '02000';
-declare exit handler for SELECT set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sensitive condition for sqlstate '02000';
-declare exit handler for sensitive set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive condition for sqlstate '02000';
-declare exit handler for sensitive set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare separator condition for sqlstate '02000';
-declare exit handler for separator set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator condition for sqlstate '02000';
-declare exit handler for separator set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set condition for sqlstate '02000';
-declare exit handler for set set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set condition for sqlstate '02000';
-declare exit handler for set set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare show condition for sqlstate '02000';
-declare exit handler for show set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show condition for sqlstate '02000';
-declare exit handler for show set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint condition for sqlstate '02000';
-declare exit handler for smallint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint condition for sqlstate '02000';
-declare exit handler for smallint set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare spatial condition for sqlstate '02000';
-declare exit handler for spatial set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial condition for sqlstate '02000';
-declare exit handler for spatial set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare specific condition for sqlstate '02000';
-declare exit handler for specific set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific condition for sqlstate '02000';
-declare exit handler for specific set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql condition for sqlstate '02000';
-declare exit handler for sql set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql condition for sqlstate '02000';
-declare exit handler for sql set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlexception condition for sqlstate '02000';
-declare exit handler for sqlexception set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception condition for sqlstate '02000';
-declare exit handler for sqlexcepti' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlstate condition for sqlstate '02000';
-declare exit handler for sqlstate set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate condition for sqlstate '02000';
-declare exit handler for sqlstate set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlwarning condition for sqlstate '02000';
-declare exit handler for sqlwarning set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning condition for sqlstate '02000';
-declare exit handler for sqlwarning s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_big_result condition for sqlstate '02000';
-declare exit handler for sql_big_result set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result condition for sqlstate '02000';
-declare exit handler for sql_big_' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_calc_found_rows condition for sqlstate '02000';
-declare exit handler for sql_calc_found_rows set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows condition for sqlstate '02000';
-declare exit handler for sql' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_small_result condition for sqlstate '02000';
-declare exit handler for sql_small_result set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result condition for sqlstate '02000';
-declare exit handler for sql_sm' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ssl condition for sqlstate '02000';
-declare exit handler for ssl set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl condition for sqlstate '02000';
-declare exit handler for ssl set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare starting condition for sqlstate '02000';
-declare exit handler for starting set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting condition for sqlstate '02000';
-declare exit handler for starting set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare straight_join condition for sqlstate '02000';
-declare exit handler for straight_join set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join condition for sqlstate '02000';
-declare exit handler for straight_' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare table condition for sqlstate '02000';
-declare exit handler for table set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table condition for sqlstate '02000';
-declare exit handler for table set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare terminated condition for sqlstate '02000';
-declare exit handler for terminated set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated condition for sqlstate '02000';
-declare exit handler for terminated s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare then condition for sqlstate '02000';
-declare exit handler for then set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then condition for sqlstate '02000';
-declare exit handler for then set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob condition for sqlstate '02000';
-declare exit handler for tinyblob set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob condition for sqlstate '02000';
-declare exit handler for tinyblob set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint condition for sqlstate '02000';
-declare exit handler for tinyint set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint condition for sqlstate '02000';
-declare exit handler for tinyint set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext condition for sqlstate '02000';
-declare exit handler for tinytext set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext condition for sqlstate '02000';
-declare exit handler for tinytext set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare to condition for sqlstate '02000';
-declare exit handler for to set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to condition for sqlstate '02000';
-declare exit handler for to set @var2 = 1;
-EN' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trailing condition for sqlstate '02000';
-declare exit handler for trailing set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing condition for sqlstate '02000';
-declare exit handler for trailing set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trigger condition for sqlstate '02000';
-declare exit handler for trigger set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger condition for sqlstate '02000';
-declare exit handler for trigger set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare true condition for sqlstate '02000';
-declare exit handler for true set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true condition for sqlstate '02000';
-declare exit handler for true set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare undo condition for sqlstate '02000';
-declare exit handler for undo set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo condition for sqlstate '02000';
-declare exit handler for undo set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare union condition for sqlstate '02000';
-declare exit handler for union set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union condition for sqlstate '02000';
-declare exit handler for union set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unique condition for sqlstate '02000';
-declare exit handler for unique set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique condition for sqlstate '02000';
-declare exit handler for unique set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unlock condition for sqlstate '02000';
-declare exit handler for unlock set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock condition for sqlstate '02000';
-declare exit handler for unlock set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unsigned condition for sqlstate '02000';
-declare exit handler for unsigned set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned condition for sqlstate '02000';
-declare exit handler for unsigned set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare update condition for sqlstate '02000';
-declare exit handler for update set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update condition for sqlstate '02000';
-declare exit handler for update set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare usage condition for sqlstate '02000';
-declare exit handler for usage set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage condition for sqlstate '02000';
-declare exit handler for usage set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare use condition for sqlstate '02000';
-declare exit handler for USE set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use condition for sqlstate '02000';
-declare exit handler for USE set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare using condition for sqlstate '02000';
-declare exit handler for using set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using condition for sqlstate '02000';
-declare exit handler for using set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_date condition for sqlstate '02000';
-declare exit handler for utc_date set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date condition for sqlstate '02000';
-declare exit handler for utc_date set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_time condition for sqlstate '02000';
-declare exit handler for utc_time set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time condition for sqlstate '02000';
-declare exit handler for utc_time set @' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_timestamp condition for sqlstate '02000';
-declare exit handler for utc_timestamp set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp condition for sqlstate '02000';
-declare exit handler for utc_times' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare values condition for sqlstate '02000';
-declare exit handler for values set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values condition for sqlstate '02000';
-declare exit handler for values set @var2' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varbinary condition for sqlstate '02000';
-declare exit handler for varbinary set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary condition for sqlstate '02000';
-declare exit handler for varbinary set' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varchar condition for sqlstate '02000';
-declare exit handler for varchar set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar condition for sqlstate '02000';
-declare exit handler for varchar set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varcharacter condition for sqlstate '02000';
-declare exit handler for varcharacter set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter condition for sqlstate '02000';
-declare exit handler for varcharact' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varying condition for sqlstate '02000';
-declare exit handler for varying set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying condition for sqlstate '02000';
-declare exit handler for varying set @va' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare when condition for sqlstate '02000';
-declare exit handler for when set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when condition for sqlstate '02000';
-declare exit handler for when set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare where condition for sqlstate '02000';
-declare exit handler for where set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where condition for sqlstate '02000';
-declare exit handler for where set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare while condition for sqlstate '02000';
-declare exit handler for while set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while condition for sqlstate '02000';
-declare exit handler for while set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare with condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare write condition for sqlstate '02000';
-declare exit handler for write set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write condition for sqlstate '02000';
-declare exit handler for write set @var2 =' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare xor condition for sqlstate '02000';
-declare exit handler for xor set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor condition for sqlstate '02000';
-declare exit handler for xor set @var2 = 1;
-' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year_month condition for sqlstate '02000';
-declare exit handler for year_month set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month condition for sqlstate '02000';
-declare exit handler for year_month s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare zerofill condition for sqlstate '02000';
-declare exit handler for zerofill set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill condition for sqlstate '02000';
-declare exit handler for zerofill set @' at line 3
-
-Testcase :
-----------
-Ensure that every possible type of handler may be declared for
-a stored procedure (continue- handler_type ).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t2(f1) values (1);
-set @x = 2;
-insert into t2(f1) values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare undo handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo handler for sqlstate '23000' set @x2 = 1;
-set @x = 1;
-insert into t values ' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare continueinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1()
-BEGIN
-declare undoinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare exitinv handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-set @x = 2;
-insert into t values (1);
-set @x = 3;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '2300' set @x2 = 1;
-set @x = 1;
-insert into t values (1);
-s' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare accessible handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'accessible handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare add handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare all handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare alter handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare analyze handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare and handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare as handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asc handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare asensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare before handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare between handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare bigint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare binary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare blob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare both handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'both handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare by handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare call handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cascade handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare case handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare change handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare char handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'char handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare character handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare check handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare collate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare column handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare condition handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare constraint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare continue handler for sqlstate '02000' set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare convert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'convert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare create handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cross handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_date handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_date handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_time handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_time handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_timestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare current_user handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_user handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare cursor handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cursor handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare database handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare databases handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_hour handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_hour handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_minute handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_minute handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare day_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dec handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare decimal handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare declare handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare default handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delayed handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare delete handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare desc handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare describe handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare deterministic handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deterministic handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinct handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare distinctrow handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinctrow handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare div handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare double handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare drop handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'drop handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare dual handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dual handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare each handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'each handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare else handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare elseif handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare enclosed handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'enclosed handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare escaped handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'escaped handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exists handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exists handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare exit handler for sqlstate '02000' set @var2 = 1;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare explain handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'explain handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare false handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'false handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fetch handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float4 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float4 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare float8 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'float8 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare for handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare force handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'force handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare foreign handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare from handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare fulltext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare grant handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare group handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare having handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare high_priority handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'high_priority handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_minute handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_minute handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare hour_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hour_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare if handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ignore handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ignore handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare in handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'in handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare index handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare infile handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'infile handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inner handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare inout handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inout handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare insert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int1 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int1 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int2 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int2 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int3 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int3 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int4 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int4 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare int8 handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int8 handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare integer handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare interval handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare into handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare is handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'is handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare iterate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare join handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare key handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare keys handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare kill handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kill handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leading handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leading handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare leave handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare left handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare like handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare limit handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare linear handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'linear handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lines handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare load handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtime handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtime handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare localtimestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localtimestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare lock handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare long handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare longtext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare loop handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare low_priority handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'low_priority handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare master_ssl_verify_server_cert handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'master_ssl_verify_server_cert handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare match handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mediumtext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare middleint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'middleint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare minute_second handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'minute_second handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare mod handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare modifies handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modifies handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare natural handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'natural handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare not handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare no_write_to_binlog handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_write_to_binlog handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare null handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare numeric handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'numeric handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare on handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optimize handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optimize handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare option handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare optionally handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'optionally handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare or handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare order handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare out handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outer handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare outfile handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outfile handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare precision handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare primary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare privileges handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare procedure handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare purge handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'purge handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare range handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare reads handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_only handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare read_write handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read_write handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare real handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'real handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare references handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare regexp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare release handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rename handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rename handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare repeat handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'repeat handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare replace handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare require handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'require handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare restrict handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restrict handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare return handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare revoke handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'revoke handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare right handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare rlike handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rlike handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schema handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare schemas handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare second_microsecond handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'second_microsecond handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare select handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sensitive handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sensitive handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare separator handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'separator handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare set handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare show handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare smallint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare spatial handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spatial handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare specific handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'specific handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlexception handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlexception handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlstate handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlstate handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sqlwarning handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlwarning handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_big_result handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_big_result handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_calc_found_rows handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_calc_found_rows handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare sql_small_result handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql_small_result handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare ssl handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare starting handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare straight_join handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'straight_join handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare table handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare terminated handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'terminated handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare then handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyblob handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyblob handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinyint handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinyint handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare tinytext handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tinytext handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare to handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trailing handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trailing handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare trigger handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare true handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare undo handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undo handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare union handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unique handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unlock handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unlock handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare unsigned handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare update handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare usage handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare use handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare using handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'using handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_date handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_date handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_time handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_time handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare utc_timestamp handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utc_timestamp handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare values handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varbinary handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varbinary handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varchar handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varcharacter handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varcharacter handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare varying handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare when handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare where handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare while handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare with handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'with handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare write handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'write handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare xor handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xor handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare year_month handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare zerofill handler for sqlstate '02000' set @var2 = 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zerofill handler for sqlstate '02000' set @var2 = 1;
-END' at line 3
-USE db_storedproc;
-
-Testcase 4.2.26:
---------------------------------------------------------------------------------
-set @v1='0';
-set @v2='0';
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x char;
-declare y char;
-declare cond1 condition for sqlstate '42000';
-declare cur1 cursor for SELECT f1 from t2 limit 1;
-declare continue handler for cond1 set @x = 4;
-set @x = '1';
-set @y = '2';
-BEGIN
-declare x char;
-declare y char;
-declare cur1 cursor for SELECT f1 from t2 limit 2, 1;
-declare continue handler for sqlstate '42000' set @x = 3;
-open cur1;
-fetch cur1 into y;
-close cur1;
-CALL nonsexist();
-SELECT x, y, @x;
-END;
-open cur1;
-fetch cur1 into y;
-close cur1;
-CALL nonsexist();
-set @v1 = @x;
-set @v2 = y;
-END//
-CALL sp1();
-x y @x
-NULL a 3
-Warnings:
-Warning 1265 Data truncated for column 'y' at row 3
-Warning 1265 Data truncated for column 'y' at row 1
-SELECT @v1, @v2;
-@v1 @v2
-4 a
-DROP PROCEDURE sp1;
-
-Testcase 4.2.28:
---------------------------------------------------------------------------------
-set @x=0;
-set @y=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set session sort_buffer_size = 10 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-set @x = 4;
-set @y = 3;
-set global sort_buffer_size = 2 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-set @@sort_buffer_size = 10 * 1024 * 1024;
-SELECT @@sort_buffer_size;
-END//
-CALL sp1();
-@@sort_buffer_size
-10485760
-@@sort_buffer_size
-10485760
-@@sort_buffer_size
-10485760
-SELECT @x, @y;
-@x @y
-4 3
-
-Testcase 4.2.29:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx char default 'x';
-declare xy char default 'y';
-declare xz char default 'z';
-set @xx = xx, @xy = xy;
-set @xz = xz;
-SELECT @xx, @xy, @xz;
-END//
-CALL sp1();
-@xx @xy @xz
-x y z
-DROP PROCEDURE sp1;
-
-Testcase 4.2.30:
---------------------------------------------------------------------------------
-set @xx=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx int;
-set xx = 'asd';
-set @xx = xx;
-SELECT @xx;
-END//
-CALL sp1();
-@xx
-0
-Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx int;
-set xx = 5;
-set @xx = xx;
-SELECT @xx;
-END//
-CALL sp1();
-@xx
-5
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - a:
---------------------------------------------------------------------------------
-set @xx=0;
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx char;
-set xx = 'temp';
-set @xx = xx;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
-SELECT @xx;
-@xx
-t
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - b:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx float;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0
-Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx float;
-set xx = 1.6;
-SELECT xx;
-END//
-CALL sp1();
-xx
-1.6
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - c:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx datetime;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0000-00-00 00:00:00
-Warnings:
-Warning 1264 Out of range value for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx datetime;
-set xx = '2006-06-06 01:01:01';
-SELECT xx;
-END//
-CALL sp1();
-xx
-2006-06-06 01:01:01
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - d:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx varchar(20);
-set xx = "abcdefghijk";
-SELECT xx;
-END//
-CALL sp1();
-xx
-abcdefghijk
-DROP PROCEDURE sp1;
-
-Testcase 4.2.31 - e:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx tinyint;
-set xx = 'asd';
-SELECT xx;
-END//
-CALL sp1();
-xx
-0
-Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column 'xx' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare xx tinyint;
-set xx = -125;
-SELECT xx;
-END//
-CALL sp1();
-xx
--125
-DROP PROCEDURE sp1;
-
-Testcase 4.2.37:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer;
-SELECT sal, f2 into x, y from t2 limit 1;
-set @x=x; set @y=y;
-END//
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x char ascii;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinytext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x text;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumtext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x longtext;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x blob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x longblob;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x binary;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x tinyint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x smallint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x mediumint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x int unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x bigint unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x decimal unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x numeric unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x real unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float unsigned;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x float unsigned zerofill;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x date;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x time;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x datetime;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x timestamp;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year;
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year(3);
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x year(4);
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x enum("1enum", "2enum");
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare x set("1set", "2set");
-SELECT f1 into x from t2 limit 1;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.38:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare notable condition for sqlstate '42S02';
-declare continue handler for notable set @x2=1;
-set @x = 1;
-insert into t2(f1) values (1);
-set @x = 2;
-insert into t2(f1) values (1);
-set @x = 3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.39:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42000';
-declare cond1 condition for sqlstate '23000';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values(1);
-END//
-ERROR 42000: Duplicate condition: cond1
-
-Testcase 4.2.41:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '1';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '1'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '12';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '12'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '1234';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '1234'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123456';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123456'
-
-Testcase 4.2.42:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'abcdefghi';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: 'abcdefghi'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42000test';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '42000test'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '00000@#$%^&';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '00000@#$%^&'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 'null';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: 'null'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate ' ';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: ' '
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate 1234567890;
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1234567890;
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull ' at line 3
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '2005-03-03';
-declare continue handler for cond1 set @var2 = 1;
-insert into tnull values( 1);
-END//
-ERROR 42000: Bad SQLSTATE: '2005-03-03'
-
-Testcase 4.2.43:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-expect failure, SQLSTATE 00000 is not an acceptable value
-for an SP's handler
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '00000';
-declare continue handler for cond1 set @var2 = 1;
-set @x=1;
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-ensure SP doesn't exist
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTS sp1;
-
-Testcase 4.2.45:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare continue handler for sqlstate '23000' set @varr1 = 5;
-declare continue handler for sqlstate '23000' set @varr3 = 7;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-DROP PROCEDURE IF EXISTS handler1;
-Warnings:
-Note 1305 PROCEDURE handler1 does not exist
-CREATE PROCEDURE handler1 ()
-BEGIN
-declare mycondition condition for sqlstate '23000';
-declare continue handler for mycondition set @varr3 = 7;
-declare continue handler for sqlstate '23000' set @varr3 = 7;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-
-Testcase 4.2.46:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '1' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '1'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '12' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '12'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '123' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '123'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '1234' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '1234'
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '123456' set @var2 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: '123456'
-
-Testcase 4.2.47:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '42s0200test' set @var2 = 1;
-insert into tnull values( 1);
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '42s0200test'
-
-Testcase 4.2.48:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-This creation should fail, SQLSTATE 00000 is unacceptable
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '00000' set @var2 = 1;
-set @x=1;
-SELECT @var2;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-Verify SP wasn't created
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE IF EXISTSsp1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTSsp1' at line 1
-
-Testcase 4.2.52:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare cur1 cursor for SELECT f1, f2 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newlf1, newf3, newsal;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Duplicate cursor: cur1
-
-Testcase 4.2.53:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, lf1, f3, f4 into @w, @x, @y, @z from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newlf1, newf3, newsal;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Cursor SELECT must not have INTO
-
-Testcase 4.2.54:
---------------------------------------------------------------------------------
-
-Testcase 4.2.55:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-ERROR 42000: Undefined CURSOR: cur1
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 0;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf3, newf4;
-set count = count - 1;
-END while;
-END;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is already open
-
-Testcase 4.2.56:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is already open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.57:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2;
-declare cur2 cursor for SELECT f1, f2 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur2;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.59:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-open cur1;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 10;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf3, newf4;
-set count = count - 1;
-END while;
-open cur1;
-close cur1;
-END;
-close cur1;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.60:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-close cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-close cur1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-open cur1;
-END;
-fetch cur1 into newf1, newf2, newf3, newf4;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.62:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf2 char(20);
-declare newf1 int1;
-declare cur1 cursor for SELECT f1, f3 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2;
-set @x = newf1;
-set @y = newf2;
-SELECT @x, @y;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-@x @y
-NULL NULL
-DROP PROCEDURE sp1;
-
-Testcase 4.2.63:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1()
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-close cur1;
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 0;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2;
-open cur1;
-END;
-close cur1;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.64:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-BEGIN
-open cur1;
-start transaction;
-fetch cur1 into newf1, newf2, newf4, newf3;
-commit;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END;
-END//
-CALL sp1();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-DROP PROCEDURE sp1;
-
-Testcase 4.2.65:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-BEGIN
-open cur1;
-fetch cur1 into newf1, newf2, newf4, newf3;
-rollback;
-fetch cur1 into newf1, newf2, newf4, newf3;
-commit;
-END;
-END//
-CALL sp1();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-DROP PROCEDURE sp1;
-
-Testcase 4.2.66:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-set count = count - 1;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-close cur1;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END;
-END//
-CALL sp1();
-ERROR 24000: Cursor is not open
-DROP PROCEDURE sp1;
-
-Testcase 4.2.67:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 20, 10;
-declare continue handler for sqlstate '02000' set done = 1;
-BEGIN
-open cur1;
-# set count = count - 1;
-# while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-# set count = count - 1;
-# END while;
-END;
-fetch cur1 into newf1, newf2, newf4, newf3;
-END//
-CALL sp1();
-DROP PROCEDURE sp1;
-
-Testcase 4.2.70:
---------------------------------------------------------------------------------
-create table temp1( f1 char(20), f2 char(20), f3 int, f4 char(20) );
-create table temp2( f1 char(20), f2 char(20), f3 int, f4 char(20) );
-DROP PROCEDURE IF EXISTS sp1;
-Warnings:
-Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( )
-BEGIN
-declare done int default 0;
-declare count integer default 20;
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf3 char(20);
-declare newf4 integer;
-declare newf21 char(20);
-declare newf22 char(20);
-declare newf23 char(20);
-declare newf24 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 7, 1;
-declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 15, 1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-BEGIN
-set count = 10;
-BEGIN
-open cur2;
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf3;
-set count = count - 1;
-END while;
-END;
-insert into temp1 values(newf1, newf2, newf4, newf3);
-close cur1;
-END;
-BEGIN
-set count = 10;
-while count > 0 do
-fetch cur2 into newf21, newf22, newf24, newf23;
-set count = count - 1;
-END while;
-END;
-insert into temp2 values(newf21, newf22, newf24, newf23);
-close cur2;
-END//
-CALL sp1();
-SELECT count(*) from temp1;
-count(*)
-1
-SELECT * from temp2;
-f1 f2 f3 f4
-NULL NULL NULL NULL
-DROP PROCEDURE sp1;
-drop table temp1;
-drop table temp2;
-
-Section 3.1.3 - Syntax checks for the stored procedure-specific flow control statements
-. IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.3.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP TABLE IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742(
-middleinitial CHAR, lastname VARCHAR(50),
-age_averylongfieldname_averylongname_1234569 INT, COMMENT VARCHAR(100))
-ENGINE=<engine_to_be_tested>;
-INSERT INTO res_t3_itisalongname_1381742_itsaverylongname_1381742
-VALUES('a', 'aaaaaaaaaabbbbbbbbc', 0, 'default');
-CREATE PROCEDURE sp1(a INT)
-BEGIN
-DECLARE itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx CHAR;
-DECLARE itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx VARCHAR(100);
-DECLARE itisjustamediumsizeintintegervariablename INTEGER;
-SET itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx = 'b';
-SET itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx
-= 'oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@%';
-SET itisjustamediumsizeintintegervariablename = 5;
-SET @comment='a';
-label1: LOOP
-IF a > 100 THEN
-SET @comment = 'value of a is greater than 100';
-ELSEIF a < 100 THEN
-IF a < 50 THEN
-SET @comment = 'value of a is less than 50';
-ELSEIF a < 25 THEN
-SET @comment = 'value of a is less than 25';
-ELSE
-SET @comment = 'value of a is greater than 50 and less than 100';
-END IF;
-ELSE
-SET @comment = 'value of a is 100';
-END IF;
-IF itisjustamediumsizeintintegervariablename = 0 THEN LEAVE label1;
-END IF;
-INSERT INTO res_t3_itisalongname_1381742_itsaverylongname_1381742
-VALUES(itisjustaverylargevariablename_xxxxxxxxxxxxxxxxxxxxx,
-CONCAT(itisjustaverylargevarcharvariablename_xxxxxxxxxxxxxxxxxxxxx,
-' ', a), a, @comment);
-SET itisjustamediumsizeintintegervariablename
-= itisjustamediumsizeintintegervariablename - 1;
-ITERATE label1;
-END LOOP label1;
-END//
-CALL sp1(101);
-CALL sp1(100);
-CALL sp1(75);
-CALL sp1(40);
-CALL sp1(20);
-CALL sp1(-1);
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742
-ORDER BY middleinitial, lastname, age_averylongfieldname_averylongname_1234569;
-middleinitial lastname age_averylongfieldname_averylongname_1234569 COMMENT
-a aaaaaaaaaabbbbbbbbc 0 default
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% -1 -1 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 100 100 value of a is 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 101 101 value of a is greater than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 20 20 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 40 40 value of a is less than 50
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-b oldmacdonalds)(*&(^^%$&^%$&^%*^)(*^#@$@% 75 75 value of a is greater than 50 and less than 100
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE sp1;
-
-Testcase 4.3.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( action char(20) )
-BEGIN
-declare v1 char(20);
-declare v2 char(20);
-declare count integer;
-set v1 = 'f1';
-set v2 = 'address';
-set count = 1;
-case when action = 'delete' then
-insert into t3 values(v1, v2, count);
-delete from t3 where f1=v1;
-when action = 'insert' then
-repeat
-insert into t3 values(v1, v2, count);
-set count = count + 1;
-until count > 5
-END repeat;
-set count = 1;
-label1: repeat
-insert into t3 values(v1, v2, count);
-if count > 5 then leave label1;
-END if;
-set count = count + 1;
-until count > 5
-END repeat;
-set count = 1;
-while count < 5 do
-insert into t3 values(v1, v2, count);
-set count = count + 1;
-END while;
-set count = 1;
-label1: while count < 5 do
-insert into t3 values(v1, v2, count);
-if count > 5 then leave label1;
-END if;
-set count = count + 1;
-END while;
-else
-set @dummystring = 'temp value';
-END case;
-END//
-CALL sp2( 'insert' );
-SELECT * from t3 where f3 <=5 && f3 >= 0;
-f1 f2 f3
-f1 address 1
-f1 address 1
-f1 address 1
-f1 address 1
-f1 address 2
-f1 address 2
-f1 address 2
-f1 address 2
-f1 address 3
-f1 address 3
-f1 address 3
-f1 address 3
-f1 address 4
-f1 address 4
-f1 address 4
-f1 address 4
-f1 address 5
-f1 address 5
-SELECT count(*) from t3;
-count(*)
-28
-CALL sp2( 'delete' );
-SELECT count(*) from t3;
-count(*)
-10
-CALL sp2 ('test');
-SELECT @dummystring;
-@dummystring
-temp value
-DROP PROCEDURE sp2;
-
-Testcase 4.1.2:
----------------
-Ensure that all sub-clauses that should not be supported are disallowed with
-an appropriate error message. (case)
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp3;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742 (name char, address varchar(50), age_averylongfieldname_averylongname_1234569 smallint);
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-label1: case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsav' at line 3
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-label1: BEGIN
-case
-action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-END label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set' at line 5
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-case
-when action = 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-then action = 'truncate' when
-truncate from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'then action = 'truncate' when
-truncate from res_t3_itisalongname_1381742_itsave' at line 6
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-declare v1 char(20);
-declare v2 char(20);
-declare count integer;
-set v1 = 'f1';
-set v2= 'address';
-set count = 1;
-case action
-when 'delete' then
-when 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when 'delete' then
-delete from res_t3_itisalongname_1381742_itsaverylongname_13' at line 11
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( action char(20) )
-BEGIN
-declare count int default 1;
-declare done int default 0;
-declare continue handler for sqlstate 'HY000' set done=1;
-label1: loop
-case
-when action = 'delete' then
-label3:BEGIN
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-END label3;
-when action = 'insert' then
-label2: while count < 10 do
-BEGIN
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742
-values('xxxxxxxxxxxxxxxxxxx', '1231230981(*&(*&)(*&(', count);
-set count = count + 1;
-if count= 10 then
-set done=1;
-END if;
-END;
-END while label2;
-else
-set @dummystring = 'temp value';
-iterate label1;
-END case;
-if done=1 then
-leave label1;
-END if;
-END loop label1;
-SELECT count, done;
-END//
-CALL sp3('insert');
-count done
-10 1
-Warnings:
-Warning 1265 Data truncated for column 'name' at row 1
-Warning 1265 Data truncated for column 'name' at row 2
-Warning 1265 Data truncated for column 'name' at row 3
-Warning 1265 Data truncated for column 'name' at row 4
-Warning 1265 Data truncated for column 'name' at row 5
-Warning 1265 Data truncated for column 'name' at row 6
-Warning 1265 Data truncated for column 'name' at row 7
-Warning 1265 Data truncated for column 'name' at row 8
-Warning 1265 Data truncated for column 'name' at row 9
-DROP PROCEDURE sp3;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-if count > 10 then leave label1;
-else
-set count = count + 1;
-elseif count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-EN' at line 9
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-else
-set count = count + 1;
-if count > 20 then
-leave label1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else
-set count = count + 1;
-if count > 20 then
-leave label1;
-END if;
-iterate lab' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-elseif count > 20 then
-leave label1;
-else
-set count=count+1;
-END if;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'elseif count > 20 then
-leave label1;
-else
-set count=count+1;
-END if;
-iterate lab' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare count int;
-set count = 1;
-label1: loop
-END if;
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END if;
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;' at line 6
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare i int default 10;
-if i > 20 then
-set i=25;
-END if
-declare count int;
-set count = 1;
-label1: loop
-if count > 20 then
-leave label1;
-else
-set count=count+1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare count int;
-set count = 1;
-label1: loop
-if count > 20 then
-leave label1;
-' at line 7
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4()
-BEGIN
-declare idummy int default 10;
-declare count int;
-set count = 1;
-label1: loop
-BEGIN
-if count < 20 then
-BEGIN
-declare idummy2 int default 10;
-set count=count+1;
-END;
-else
-BEGIN
-SELECT idummy2;
-leave label1;
-END;
-END if;
-iterate label1;
-END;
-END loop label1;
-END//
-CALL sp4();
-ERROR 42S22: Unknown column 'idummy2' in 'field list'
-DROP PROCEDURE sp4;
-
-Testcase 4.3.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5()
-BEGIN
-declare count integer default 1;
-set count = 1;
-case
-else
-set count = 10;
-when count = 1 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else
-set count = 10;
-when count = 1 then
-set count = count + 1;
-END case;
-END' at line 6
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-when case count = 1 then
-set count = 10;
-when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when case count = 1 then
-set count = 10;
-when count = 2 then
-set count = count' at line 3
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-END case;
-when count = 1 then
-set count = 10;
-when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case;
-when count = 1 then
-set count = 10;
-when count = 2 then
-set count = coun' at line 3
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5(count int)
-BEGIN
-when count = 1 then
-set count = 10;
-case when count = 2 then
-set count = count + 1;
-END case;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'when count = 1 then
-set count = 10;
-case when count = 2 then
-set count = count' at line 3
-
-Testcase 4.3.6:
----------------
-Ensure that all supported sub-clauses are supported only in the correct order (repeat).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-until count1 > 5
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat;
-until count1 > 5
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: until count1 > 5
-repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'until count1 > 5
-repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1' at line 4
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: END repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-until count1 > 5
-repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-unt' at line 4
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END repeat;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-if count1 > 5 then leave label1; END if;
-until count1 > 10;
-SELECT count1;
-END repeat;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-SELECT count1;
-END repeat;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6()
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1-1;
-until count1 < 0
-END repeat label1;
-SELECT count1;
-END//
-CALL sp6();
-count1
--1
-DROP PROCEDURE sp6;
-
-Testcase 4.3.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: loop
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-label1 iterate;
-END label1 loop;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate;
-END label1 loop;
-END' at line 7
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: END loop;
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-iterate label1;
-loop;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END loop;
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END ' at line 3
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7()
-BEGIN
-label1: iterate label1;
-loop
-set @dummystring = 'temp value';
-if count > 10 then leave label1;
-END if;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iterate label1;
-loop
-set @dummystring = 'temp value';
-if count > 10 then leave l' at line 3
-
-Testcase 4.3.8:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-do while v1 > 0
-set v1 = v1 - 1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while v1 > 0
-set v1 = v1 - 1;
-END while;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-do v1 > 0 while
-set v1 = v1 - 1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while
-set v1 = v1 - 1;
-END while;
-END' at line 4
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8()
-BEGIN
-declare v1 int default 5;
-END while;
-set v1 = v1 - 1;
-while v1 > 0 do;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while;
-set v1 = v1 - 1;
-while v1 > 0 do;
-END' at line 4
-
-Testcase 4.3.12:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp12;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp12( )
-BEGIN
-declare count1 integer default 1;
-declare count2 int;
-label1: loop
-if count1 > 2 then leave label1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-label2: loop
-if count2 > 2 then leave label2;
-END if;
-set count2 = count2 + 1;
-END loop label1;
-set count1 = count1 + 1;
-iterate label1;
-END loop label2;
-END//
-ERROR 42000: End-label label1 without match
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.13:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp13;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp13( )
-BEGIN
-declare count1 integer default 1;
-lable1: loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop;
-END//
-CALL sp13();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 1
-xyz pqr 2
-DROP PROCEDURE sp13;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.14:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp14;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp14( )
-BEGIN
-declare count1 integer default 1;
-loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop label1;
-END//
-ERROR 42000: LEAVE with no matching label: lable1
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 4.3.15:
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp15;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp15( )
-BEGIN
-declare count1 integer default 1;
-label1 loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate lable1;
-END loop label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop
-if count1 > 2 then leave lable1;
-END if;
-insert into res_t3_itisalongname_1' at line 4
-
-Testcase 4.3.16:
-----------------
-Ensure that every beginning label with the same scope must be unique.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp16;
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE PROCEDURE sp16( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-set count2 = 1;
-label1: repeat
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( xyz , pqr, count1);
-until count2 > 3
-END repeat label1;
-until count1 > 3
-END repeat label1;
-END//
-ERROR 42000: Redefining label label1
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-declare count3 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-label1: repeat
-set count2 = count2 + 1;
-SELECT count2;
-until count2 > 3
-END repeat label1;
-SELECT count1;
-until count1 > 3
-END repeat label1;
-label1: repeat
-set count3 = count3 + 1;
-SELECT count3;
-until count3 > 3
-END repeat label1;
-END//
-ERROR 42000: Redefining label label1
-
-Testcase 4.3.17:
---------------------------------------------------------------------------------
-
-Testcase 4.3.18:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp18;
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE PROCEDURE sp18( )
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat label2;
-END//
-ERROR 42000: End-label label2 without match
-
-Testcase 4.3.19:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp19;
-CREATE PROCEDURE sp19( )
-BEGIN
-declare count1 integer default 1;
-label1: repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat;
-END//
-CALL sp19();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-DROP PROCEDURE sp19;
-
-Testcase 4.3.20:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp20;
-CREATE PROCEDURE sp20( )
-BEGIN
-declare count1 integer default 1;
-repeat
-set count1 = count1 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count1 < 3
-END repeat label1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'label1;
-END' at line 8
-
-Testcase 4.3.21:
---------------------------------------------------------------------------------
-
-Testcase 4.3.22:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-label1: while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while label2;
-END while;
-END//
-ERROR 42000: End-label label2 without match
-
-Testcase 4.3.23:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while label1;
-END while;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'label1;
-END while;
-END' at line 11
-
-Testcase 4.3.25:
---------------------------------------------------------------------------------
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-while count1 < 3 do
-set count1 = count1 + 1;
-set count2 = 1;
-label1: while count2 < 3 do
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-END while;
-END while;
-END//
-CALL sp25 ();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-xyz pqr 2
-xyz pqr 3
-xyz pqr 3
-DROP PROCEDURE sp25;
-drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Section 3.1.4 - Checks for the global nature of stored procedures:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.4.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP DATABASE IF EXISTS d40401;
-CREATE PROCEDURE sp1 ( n char(20) )
-BEGIN
-SELECT n;
-END//
-CREATE DATABASE d40401;
-USE d40401;
-CALL db_storedproc.sp1('abcd');
-n
-abcd
-USE db_storedproc;
-DROP PROCEDURE sp1;
-DROP DATABASE d40401;
-
-Testcase 4.4.2:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-DROP FUNCTION IF EXISTS fn11;
-DROP DATABASE IF EXISTS d40402;
-CREATE FUNCTION fn1(n int) returns int
-BEGIN
-declare a int;
-set a = 9 * n;
-return a;
-END//
-CREATE DATABASE d40402;
-USE d40402;
-SELECT db_storedproc.fn1(100);
-db_storedproc.fn1(100)
-900
-SELECT db_storedproc.fn1(1000);
-db_storedproc.fn1(1000)
-9000
-CREATE FUNCTION db_storedproc.fn11(n int) returns int
-BEGIN
-declare a int;
-set a = 9 * n;
-return a;
-END//
-SELECT db_storedproc.fn11(100);
-db_storedproc.fn11(100)
-900
-SELECT db_storedproc.fn11(1000);
-db_storedproc.fn11(1000)
-9000
-USE db_storedproc;
-DROP FUNCTION fn1;
-DROP FUNCTION fn11;
-DROP DATABASE d40402;
-
-Testcase 4.4.3:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-DROP DATABASE IF EXISTS d2;
-CREATE DATABASE d1;
-CREATE DATABASE d2;
-USE d1;
-create table res_t41(a char(5), b char(10));
-insert into res_t41 values('abcde', 'a!@#$%^&*(');
-USE d2;
-create table res_t42(a char(5), b char(10));
-USE d1;
-CREATE PROCEDURE sp2(n char (20))
-BEGIN
-SELECT res_t41.a, res_t41.b into @a, @b from res_t41 where res_t41.b = n;
-insert into d2.res_t42 values (@a, @b);
-END//
-USE d2;
-CALL d1.sp2('a!@#$%^&*(');
-show warnings;
-Level Code Message
-SELECT * from d1.res_t41;
-a b
-abcde a!@#$%^&*(
-SELECT * from res_t42;
-a b
-abcde a!@#$%^&*(
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE d2;
-
-Testcase 4.4.4:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-CREATE PROCEDURE sp3()
-BEGIN
-USE d1;
-END//
-ERROR 0A000: USE is not allowed in stored procedures
-USE db_storedproc;
-DROP DATABASE d1;
-
-Testcase 4.4.5:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-create table t43(a char(5), b char(10));
-insert into t43 values('abcde', 'a!@#$%^&*(');
-CREATE PROCEDURE d1.sp4()
-SELECT * from d1.t43;
-SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43
-USE db_storedproc;
-DROP DATABASE d1;
-CREATE DATABASE d1;
-USE d1;
-create table t44(a char(5), b char(10));
-SELECT * from mysql.proc where specific_name = 'sp4';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-USE db_storedproc;
-DROP DATABASE d1;
-
-Testcase 4.4.6:
---------------------------------------------------------------------------------
-USE db_storedproc;
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5()
-SELECT * from db_storedproc.t4 limit 0, 10;
-SELECT db from mysql.proc where specific_name = 'sp5';
-db
-db_storedproc
-DROP PROCEDURE sp5;
-
-Testcase 4.4.7:
---------------------------------------------------------------------------------
-USE db_storedproc;
-drop table IF EXISTS t46;
-DROP PROCEDURE IF EXISTS sp6;
-create table t46(f1 char(20), f2 char(20));
-insert into t46 values ('abcd', 'wxyz');
-CREATE PROCEDURE db_storedproc.sp6()
-SELECT * from db_storedproc.t4 limit 0, 10;
-SELECT db from mysql.proc where specific_name = 'sp6';
-db
-db_storedproc
-drop table t46;
-DROP PROCEDURE sp6;
-
-Testcase 4.4.8:
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-DROP DATABASE IF EXISTS d2;
-CREATE DATABASE d1;
-CREATE DATABASE d2;
-USE d1;
-CREATE PROCEDURE sp8 ( n char(20) ) sql security definer comment 'initial'
- SELECT * from t1 where t1.f1 = n;
-USE d2;
-alter procedure d1.sp8 sql security definer comment 'updated';
-SELECT * from mysql.proc where specific_name='sp8' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
-
-Testcase 4.4.9:
---------------------------------------------------------------------------------
-USE d1;
-DROP FUNCTION IF EXISTS fn1;
-DROP FUNCTION IF EXISTS fn11;
-CREATE FUNCTION d1.fn2(n int) returns int sql security invoker comment 'initial'
-BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END//
-USE d2;
-alter function d1.fn2 sql security definer comment 'updated';
-SELECT * from mysql.proc where specific_name='fn2' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-d1 fn2 FUNCTION fn2 SQL CONTAINS_SQL NO DEFINER n int int(11) BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END
-
-Testcase 4.4.10:
---------------------------------------------------------------------------------
-USE d1;
-CREATE PROCEDURE sp9 ( n char(20) )
-SELECT * from t1 where t1.f1 = n;
-USE d2;
-DROP PROCEDURE d1.sp9;
-SELECT * from mysql.proc where specific_name='sp9' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-
-Testcase 4.4.11:
---------------------------------------------------------------------------------
-USE d1;
-CREATE FUNCTION d1.fn3(n int) returns int
-BEGIN
-declare a int;
-set a = 0.9 * n;
-return a;
-END//
-USE d2;
-DROP FUNCTION d1.fn3;
-SELECT * from mysql.proc where specific_name='fn3' and db='d1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE d2;
-
-Section 3.1.5 - Parameter use checks:
-Functions with all data types
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS d1;
-CREATE DATABASE d1;
-USE d1;
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 bigint) returns bigint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn1(-9.22e+18);
-fn1(-9.22e+18)
--9220000000000000000
-DROP FUNCTION IF EXISTS fn2;
-CREATE FUNCTION fn2( f1 bigint unsigned) returns bigint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn2(1.84e+19);
-fn2(1.84e+19)
-18400000000000000000
-DROP FUNCTION IF EXISTS fn3;
-CREATE FUNCTION fn3( f1 bigint unsigned zerofill) returns bigint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn3(1.84e+17);
-fn3(1.84e+17)
-184000000000000000
-DROP FUNCTION IF EXISTS fn4;
-CREATE FUNCTION fn4( f1 bigint zerofill) returns bigint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn4(-9.22e+15);
-fn4(-9.22e+15)
-0
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn5;
-CREATE FUNCTION fn5( f1 decimal) returns decimal
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn5(-1.00e+09);
-fn5(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn6;
-CREATE FUNCTION fn6( f1 decimal (0)) returns decimal (0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn6(-1.00e+09);
-fn6(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn7;
-CREATE FUNCTION fn7( f1 decimal (0) unsigned) returns decimal (0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn7(99999999999);
-fn7(99999999999)
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn8;
-CREATE FUNCTION fn8( f1 decimal (0) unsigned zerofill) returns decimal (0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn8(999999999);
-fn8(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn9;
-CREATE FUNCTION fn9( f1 decimal (0) zerofill) returns decimal (0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn9(-1.00e+09);
-fn9(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn10;
-CREATE FUNCTION fn10( f1 decimal (0, 0)) returns decimal (0, 0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn10(-1.00e+09);
-fn10(-1.00e+09)
--1000000000
-DROP FUNCTION IF EXISTS fn11;
-CREATE FUNCTION fn11( f1 decimal (0, 0) unsigned) returns decimal (0, 0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn11(99999999999);
-fn11(99999999999)
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn12;
-CREATE FUNCTION fn12( f1 decimal (0, 0) unsigned zerofill) returns decimal (0, 0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn12(999999999);
-fn12(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn13;
-CREATE FUNCTION fn13( f1 decimal (0, 0) zerofill) returns decimal (0, 0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn13(-1.00e+09);
-fn13(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn14;
-CREATE FUNCTION fn14( f1 decimal (63, 30)) returns decimal (63, 30)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn14(-1.00e+21);
-fn14(-1.00e+21)
--1000000000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn15;
-CREATE FUNCTION fn15( f1 decimal (63, 30) unsigned) returns decimal (63, 30) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn15(1.00e+16);
-fn15(1.00e+16)
-10000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn16;
-CREATE FUNCTION fn16( f1 decimal (63, 30) unsigned zerofill) returns decimal (63, 30) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn16(1.00e+16);
-fn16(1.00e+16)
-000000000000000010000000000000000.000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn17;
-CREATE FUNCTION fn17( f1 decimal (63, 30) zerofill) returns decimal (63, 30) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn17(-1.00e+21);
-fn17(-1.00e+21)
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn18_d;
-CREATE FUNCTION fn18_d( f1 decimal (64)) returns decimal (64)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn18_d( -1000000000000000000000000000000 );
-fn18_d( -1000000000000000000000000000000 )
--1000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn19_du;
-CREATE FUNCTION fn19_du( f1 decimal (64) unsigned) returns decimal (64) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn19_du( 100000000000000000000 );
-fn19_du( 100000000000000000000 )
-100000000000000000000
-DROP FUNCTION IF EXISTS fn20_duz;
-CREATE FUNCTION fn20_duz( f1 decimal (64) unsigned zerofill) returns decimal (64) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn20_duz( 1000000000000000000000000 );
-fn20_duz( 1000000000000000000000000 )
-0000000000000000000000000000000000000001000000000000000000000000
-DROP FUNCTION IF EXISTS fn21_d_z;
-CREATE FUNCTION fn21_d_z( f1 decimal (64) zerofill) returns decimal (64) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn21_d_z(1.00e+00);
-fn21_d_z(1.00e+00)
-0000000000000000000000000000000000000000000000000000000000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn22;
-CREATE FUNCTION fn22( f1 decimal unsigned) returns decimal unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn22(1.00e+00);
-fn22(1.00e+00)
-10
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn23;
-CREATE FUNCTION fn23( f1 decimal unsigned zerofill) returns decimal unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn23(1.00e+00);
-fn23(1.00e+00)
-0000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn24;
-CREATE FUNCTION fn24( f1 decimal zerofill) returns decimal zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn24(-1.00e+09);
-fn24(-1.00e+09)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn25;
-CREATE FUNCTION fn25( f1 double) returns double
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn25(1.00e+00);
-fn25(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn26;
-CREATE FUNCTION fn26( f1 double unsigned) returns double unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn26(1.00e+00);
-fn26(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn27;
-CREATE FUNCTION fn27( f1 double unsigned zerofill) returns double unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn27(1.00e+00);
-fn27(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn28;
-CREATE FUNCTION fn28( f1 double zerofill) returns double zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn28(1.00e+00);
-fn28(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn29;
-CREATE FUNCTION fn29( f1 float) returns float
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn29(1.00e+00);
-fn29(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn30;
-CREATE FUNCTION fn30( f1 float unsigned) returns float unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn30(1.00e+00);
-fn30(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn31;
-CREATE FUNCTION fn31( f1 float unsigned zerofill) returns float unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn31(1.00e+00);
-fn31(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn32;
-CREATE FUNCTION fn32( f1 float zerofill) returns float zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn32(1.00e+00);
-fn32(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn33;
-CREATE FUNCTION fn33( f1 float(0)) returns float(0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn33(1.00e+00);
-fn33(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn34;
-CREATE FUNCTION fn34( f1 float(0) unsigned) returns float(0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn34(1.00e+00);
-fn34(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn35;
-CREATE FUNCTION fn35( f1 float(0) unsigned zerofill) returns float(0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn35(1.00e+00);
-fn35(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn36;
-CREATE FUNCTION fn36( f1 float(0) zerofill) returns float(0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn36(1.00e+00);
-fn36(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn37;
-CREATE FUNCTION fn37( f1 float(23)) returns float(23)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn37(1.00e+00);
-fn37(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn38;
-CREATE FUNCTION fn38( f1 float(23) unsigned) returns float(23) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn38(1.00e+00);
-fn38(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn39;
-CREATE FUNCTION fn39( f1 float(23) unsigned zerofill) returns float(23) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn39(1.00e+00);
-fn39(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn40;
-CREATE FUNCTION fn40( f1 float(23) zerofill) returns float(23) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn40(1.00e+00);
-fn40(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn41;
-CREATE FUNCTION fn41( f1 float(24)) returns float(24)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn41(1.00e+00);
-fn41(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn42;
-CREATE FUNCTION fn42( f1 float(24) unsigned) returns float(24) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn42(1.00e+00);
-fn42(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn43;
-CREATE FUNCTION fn43( f1 float(24) unsigned zerofill) returns float(24) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn43(1.00e+00);
-fn43(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn44;
-CREATE FUNCTION fn44( f1 float(24) zerofill) returns float(24) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn44(1.00e+00);
-fn44(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn45;
-CREATE FUNCTION fn45( f1 float(53)) returns float(53)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn45(1.00e+00);
-fn45(1.00e+00)
-1
-DROP FUNCTION IF EXISTS fn46;
-CREATE FUNCTION fn46( f1 float(53) unsigned) returns float(53) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn46(1.00e+00);
-fn46(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn47;
-CREATE FUNCTION fn47( f1 float(53) unsigned zerofill) returns float(53) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn47(1.00e+00);
-fn47(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn48;
-CREATE FUNCTION fn48( f1 float(53) zerofill) returns float(53) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn48(1.00e+00);
-fn48(1.00e+00)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn49;
-CREATE FUNCTION fn49( f1 int) returns int
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn49(-2.15e+09);
-fn49(-2.15e+09)
--2147483638
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn50;
-CREATE FUNCTION fn50( f1 int unsigned) returns int unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn50(4.29e+09);
-fn50(4.29e+09)
-4290000000
-DROP FUNCTION IF EXISTS fn51;
-CREATE FUNCTION fn51( f1 int unsigned zerofill) returns int unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn51(4.29e+09);
-fn51(4.29e+09)
-4290000000
-DROP FUNCTION IF EXISTS fn52;
-CREATE FUNCTION fn52( f1 int zerofill) returns int zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn52(2.15e+08);
-fn52(2.15e+08)
-215000000
-DROP FUNCTION IF EXISTS fn53;
-CREATE FUNCTION fn53( f1 mediumint) returns mediumint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn53(-8388600);
-fn53(-8388600)
--8388598
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn54;
-CREATE FUNCTION fn54( f1 mediumint unsigned) returns mediumint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn54(16777201);
-fn54(16777201)
-16777202
-DROP FUNCTION IF EXISTS fn55;
-CREATE FUNCTION fn55( f1 mediumint unsigned zerofill) returns mediumint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn55(16777210);
-fn55(16777210)
-16777210
-DROP FUNCTION IF EXISTS fn56;
-CREATE FUNCTION fn56( f1 mediumint zerofill) returns mediumint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn56(-8388601);
-fn56(-8388601)
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn57;
-CREATE FUNCTION fn57( f1 numeric) returns numeric
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn57(-999999999);
-fn57(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn58;
-CREATE FUNCTION fn58( f1 numeric (0)) returns numeric (0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn58(-999999999);
-fn58(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn59;
-CREATE FUNCTION fn59( f1 numeric (0) unsigned) returns numeric (0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn59(9999999999);
-fn59(9999999999)
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn60;
-CREATE FUNCTION fn60( f1 numeric (0) unsigned zerofill) returns numeric (0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn60(99999999);
-fn60(99999999)
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn61;
-CREATE FUNCTION fn61( f1 numeric (0) zerofill) returns numeric (0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn61(-99999999);
-fn61(-99999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn62;
-CREATE FUNCTION fn62( f1 numeric (0, 0)) returns numeric (0, 0)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn62(-999999999);
-fn62(-999999999)
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn63;
-CREATE FUNCTION fn63( f1 numeric (0, 0) unsigned) returns numeric (0, 0) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn63(9999999999);
-fn63(9999999999)
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn64;
-CREATE FUNCTION fn64( f1 numeric (0, 0) unsigned zerofill) returns numeric (0, 0) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn64(99999999);
-fn64(99999999)
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn65;
-CREATE FUNCTION fn65( f1 numeric (0, 0) zerofill) returns numeric (0, 0) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn65(-99999999);
-fn65(-99999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn66;
-CREATE FUNCTION fn66( f1 numeric (63, 30)) returns numeric (63, 30)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn66(-1e+36);
-fn66(-1e+36)
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn67;
-CREATE FUNCTION fn67( f1 numeric (63, 30) unsigned) returns numeric (63, 30) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn67(1e+36);
-fn67(1e+36)
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn68;
-CREATE FUNCTION fn68( f1 numeric (63, 30) unsigned zerofill) returns numeric (63, 30) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn68(1e+36);
-fn68(1e+36)
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn69;
-CREATE FUNCTION fn69( f1 numeric (63, 30) zerofill) returns numeric (63, 30) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn69(-1e+36);
-fn69(-1e+36)
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn70_n;
-CREATE FUNCTION fn70_n( f1 numeric (64)) returns numeric (64)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn70_n( -1000000000000000000000000000000 );
-fn70_n( -1000000000000000000000000000000 )
--1000000000000000000000000000000
-SELECT fn70_n( -10000000000000000000000000000000000000000 );
-fn70_n( -10000000000000000000000000000000000000000 )
--10000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn71_nu;
-CREATE FUNCTION fn71_nu( f1 numeric (64) unsigned) returns numeric (64) unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn71_nu( 10000000000000000000000000000000000000000 );
-fn71_nu( 10000000000000000000000000000000000000000 )
-10000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn72_nuz;
-CREATE FUNCTION fn72_nuz( f1 numeric (64) unsigned zerofill) returns numeric (64) unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn72_nuz( 10000000000000000000000000000000000000000 );
-fn72_nuz( 10000000000000000000000000000000000000000 )
-0000000000000000000000010000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn73_n_z;
-CREATE FUNCTION fn73_n_z( f1 numeric (64) zerofill) returns numeric (64) zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn73_n_z( 10000000000000000000000000000000000000000 );
-fn73_n_z( 10000000000000000000000000000000000000000 )
-0000000000000000000000010000000000000000000000000000000000000000
-DROP FUNCTION IF EXISTS fn74;
-CREATE FUNCTION fn74( f1 numeric unsigned) returns numeric unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn74(999999999);
-fn74(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn75;
-CREATE FUNCTION fn75( f1 numeric unsigned zerofill) returns numeric unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn75(999999999);
-fn75(999999999)
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn76;
-CREATE FUNCTION fn76( f1 numeric zerofill) returns numeric zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn76(-999999999);
-fn76(-999999999)
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn77;
-CREATE FUNCTION fn77( f1 real) returns real
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn77(1.1);
-fn77(1.1)
-1.1
-DROP FUNCTION IF EXISTS fn78;
-CREATE FUNCTION fn78( f1 real unsigned) returns real unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn78(1.1);
-fn78(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn79;
-CREATE FUNCTION fn79( f1 real unsigned zerofill) returns real unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn79(1.1);
-fn79(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn80;
-CREATE FUNCTION fn80( f1 real zerofill) returns real zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn80(1.1);
-fn80(1.1)
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn81;
-CREATE FUNCTION fn81( f1 smallint) returns smallint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn81(-32701);
-fn81(-32701)
--32702
-DROP FUNCTION IF EXISTS fn82;
-CREATE FUNCTION fn82( f1 smallint unsigned) returns smallint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn82(65531);
-fn82(65531)
-65532
-DROP FUNCTION IF EXISTS fn83;
-CREATE FUNCTION fn83( f1 smallint unsigned zerofill) returns smallint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn83(65531);
-fn83(65531)
-65532
-DROP FUNCTION IF EXISTS fn84;
-CREATE FUNCTION fn84( f1 smallint zerofill) returns smallint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn84(-32601);
-fn84(-32601)
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn85;
-CREATE FUNCTION fn85( f1 tinyint) returns tinyint
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn85(-115);
-fn85(-115)
--116
-DROP FUNCTION IF EXISTS fn86;
-CREATE FUNCTION fn86( f1 tinyint unsigned) returns tinyint unsigned
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn86(251);
-fn86(251)
-252
-DROP FUNCTION IF EXISTS fn87;
-CREATE FUNCTION fn87( f1 tinyint unsigned zerofill) returns tinyint unsigned zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn87(201);
-fn87(201)
-202
-DROP FUNCTION IF EXISTS fn88;
-CREATE FUNCTION fn88( f1 tinyint zerofill) returns tinyint zerofill
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-return f1;
-END//
-SELECT fn88(-101);
-fn88(-101)
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn89;
-CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
-BEGIN
-IF f1 = '1enum' THEN
-SET f1 = '2enum';
-ELSE
-SET f1 = '1enum';
-END IF;
-RETURN f1;
-END//
-SELECT fn89( '1enum');
-fn89( '1enum')
-2enum
-DROP FUNCTION IF EXISTS fn90;
-CREATE FUNCTION fn90( f1 set('1set', '2set')) returns set('1set', '2set')
-BEGIN
-IF f1 = '1set' THEN
-SET f1 = '2set';
-ELSE
-SET f1 = '1set';
-END IF;
-RETURN f1;
-END//
-SELECT fn90( '1set');
-fn90( '1set')
-2set
-DROP FUNCTION IF EXISTS fn91;
-CREATE FUNCTION fn91( f1 date) returns date
-BEGIN
-set f1 = adddate(f1, interval 31 day);
-return f1;
-END//
-SELECT fn91('1997-12-31');
-fn91('1997-12-31')
-1998-01-31
-DROP FUNCTION IF EXISTS fn92;
-CREATE FUNCTION fn92( f1 time) returns time
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998');
-return f1;
-END//
-SELECT fn92( '23:59:59.999999');
-fn92( '23:59:59.999999')
-25:59:59
-DROP FUNCTION IF EXISTS fn93;
-CREATE FUNCTION fn93( f1 datetime) returns datetime
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002');
-return f1;
-END//
-SELECT fn93('1997-12-31 23:59:59.999999');
-fn93('1997-12-31 23:59:59.999999')
-1998-01-02 01:01:00
-DROP FUNCTION IF EXISTS fn94;
-CREATE FUNCTION fn94( f1 char) returns char
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn94( 'h');
-fn94( 'h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn95;
-CREATE FUNCTION fn95( f1 char ascii) returns char ascii
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn95('h');
-fn95('h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn96;
-CREATE FUNCTION fn96( f1 binary) returns binary(2)
-BEGIN
-set f1 = concat('a', f1);
-return f1;
-END//
-SELECT fn96( 'h');
-fn96( 'h')
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP FUNCTION IF EXISTS fn97;
-CREATE FUNCTION fn97( f1 longtext) returns longtext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn97( 'world');
-fn97( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn98;
-CREATE FUNCTION fn98( f1 mediumtext) returns mediumtext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn98( 'world');
-fn98( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn99;
-CREATE FUNCTION fn99( f1 text) returns text
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn99( 'world');
-fn99( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn100;
-CREATE FUNCTION fn100( f1 tinytext) returns tinytext
-BEGIN
-set f1 = concat('hello', f1);
-return f1;
-END//
-SELECT fn100( 'world');
-fn100( 'world')
-helloworld
-DROP FUNCTION IF EXISTS fn101;
-CREATE FUNCTION fn101( f1 year) returns year
-BEGIN
-set f1 = f1 + 10;
-return f1;
-END//
-SELECT fn101(51);
-fn101(51)
-2061
-DROP FUNCTION IF EXISTS fn102;
-CREATE FUNCTION fn102( f1 year(4)) returns year(4)
-BEGIN
-set f1 = f1 + 51;
-return f1;
-END//
-SELECT fn102(1982);
-fn102(1982)
-2033
-DROP FUNCTION IF EXISTS fn103;
-CREATE FUNCTION fn103( f1 geometrycollection) returns geometrycollection
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\
-
-DROP FUNCTION IF EXISTS fn104;
-CREATE FUNCTION fn104( f1 linestring) returns linestring
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@')
-
-DROP FUNCTION IF EXISTS fn105;
-CREATE FUNCTION fn105( f1 point) returns point
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@');
-fn105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@')
-
-DROP FUNCTION IF EXISTS fn106;
-CREATE FUNCTION fn106( f1 polygon) returns polygon
-BEGIN
-set f1 = f1;
-return f1;
-END//
-SELECT fn106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-fn106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\
-
-DROP FUNCTION IF EXISTS fn107;
-CREATE FUNCTION fn107( f1 timestamp) returns timestamp
-BEGIN
-set f1 = now();
-return f1;
-END//
-SELECT fn107(20050510080451);
-fn107(20050510080451)
-returned
-USE db_storedproc;
-DROP DATABASE d1;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-USE db1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp1(-9.22e+18);
-f1
--9220000000000000000
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( f1 bigint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp2(1.84e+19);
-f1
-18400000000000000000
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( f1 bigint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp3(1.84e+17);
-f1
-00184000000000000000
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4( f1 bigint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp4(-9.22e+15);
-f1
-00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp5;
-CREATE PROCEDURE sp5( f1 decimal)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp5(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( f1 decimal (0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp6(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp7;
-CREATE PROCEDURE sp7( f1 decimal (0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp7(99999999999);
-f1
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp8(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp9;
-CREATE PROCEDURE sp9( f1 decimal (0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp9(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp10;
-CREATE PROCEDURE sp10( f1 decimal (0, 0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp10(-1.00e+09);
-f1
--1000000000
-DROP PROCEDURE IF EXISTS sp11;
-CREATE PROCEDURE sp11( f1 decimal (0, 0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp11(99999999999);
-f1
-9999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp12;
-CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp12(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp13;
-CREATE PROCEDURE sp13( f1 decimal (0, 0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp13(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp14;
-CREATE PROCEDURE sp14( f1 decimal (63, 30))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp14(-1.00e+21);
-f1
--1000000000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp15;
-CREATE PROCEDURE sp15( f1 decimal (63, 30) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp15(1.00e+16);
-f1
-10000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( f1 decimal (63, 30) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp16(1.00e+16);
-f1
-000000000000000010000000000000000.000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp17;
-CREATE PROCEDURE sp17( f1 decimal (63, 30) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp17(-1.00e+21);
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp18_d;
-CREATE PROCEDURE sp18_d( f1 decimal (64))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp18_d(-1.00e+30);
-f1
--1000000000000000000000000000000
-CALL sp18_d( -1000000000000000000000000000000 );
-f1
--1000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp19_du;
-CREATE PROCEDURE sp19_du( f1 decimal (64) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp19_du(1.00e+20);
-f1
-100000000000000000000
-CALL sp19_du( 100000000000000000000 );
-f1
-100000000000000000000
-CALL sp19_du(1.00e+24);
-f1
-1000000000000000000000000
-CALL sp19_du( 1000000000000000000000000 );
-f1
-1000000000000000000000000
-DROP PROCEDURE IF EXISTS sp20_duz;
-CREATE PROCEDURE sp20_duz( f1 decimal (64) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp20_duz(1.00e+20);
-f1
-0000000000000000000000000000000000000000000100000000000000000000
-CALL sp20_duz( 100000000000000000000 );
-f1
-0000000000000000000000000000000000000000000100000000000000000000
-CALL sp20_duz(1.00e+24);
-f1
-0000000000000000000000000000000000000001000000000000000000000000
-CALL sp20_duz( 1000000000000000000000000 );
-f1
-0000000000000000000000000000000000000001000000000000000000000000
-DROP PROCEDURE IF EXISTS sp21;
-CREATE PROCEDURE sp21( f1 decimal (64) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp21(1.00e+00);
-f1
-0000000000000000000000000000000000000000000000000000000000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( f1 decimal unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp22(1.00e+00);
-f1
-10
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp23(1.00e+00);
-f1
-0000000010
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp24;
-CREATE PROCEDURE sp24( f1 decimal zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp24(-1.00e+09);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( f1 double)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp25(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp26;
-CREATE PROCEDURE sp26( f1 double unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp26(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp27;
-CREATE PROCEDURE sp27( f1 double unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp27(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp28;
-CREATE PROCEDURE sp28( f1 double zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp28(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp29;
-CREATE PROCEDURE sp29( f1 float)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp29(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp30;
-CREATE PROCEDURE sp30( f1 float unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp30(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp31;
-CREATE PROCEDURE sp31( f1 float unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp31(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp32;
-CREATE PROCEDURE sp32( f1 float zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp32(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp33;
-CREATE PROCEDURE sp33( f1 float(0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp33(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp34;
-CREATE PROCEDURE sp34( f1 float(0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp34(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp35;
-CREATE PROCEDURE sp35( f1 float(0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp35(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp36;
-CREATE PROCEDURE sp36( f1 float(0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp36(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp37;
-CREATE PROCEDURE sp37( f1 float(23))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp37(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp38;
-CREATE PROCEDURE sp38( f1 float(23) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp38(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp39;
-CREATE PROCEDURE sp39( f1 float(23) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp39(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp40;
-CREATE PROCEDURE sp40( f1 float(23) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp40(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp41;
-CREATE PROCEDURE sp41( f1 float(24))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp41(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp42;
-CREATE PROCEDURE sp42( f1 float(24) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp42(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp43;
-CREATE PROCEDURE sp43( f1 float(24) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp43(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp44;
-CREATE PROCEDURE sp44( f1 float(24) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp44(1.00e+00);
-f1
-000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp45;
-CREATE PROCEDURE sp45( f1 float(53))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp45(1.00e+00);
-f1
-1
-DROP PROCEDURE IF EXISTS sp46;
-CREATE PROCEDURE sp46( f1 float(53) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp46(1.00e+00);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp47;
-CREATE PROCEDURE sp47( f1 float(53) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp47(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp48;
-CREATE PROCEDURE sp48( f1 float(53) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp48(1.00e+00);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp49;
-CREATE PROCEDURE sp49( f1 int)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp49(-2.15e+09);
-f1
--2147483638
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp50;
-CREATE PROCEDURE sp50( f1 int unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp50(4.29e+09);
-f1
-4290000000
-DROP PROCEDURE IF EXISTS sp51;
-CREATE PROCEDURE sp51( f1 int unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp51(4.29e+09);
-f1
-4290000000
-DROP PROCEDURE IF EXISTS sp52;
-CREATE PROCEDURE sp52( f1 int zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp52(2.15e+08);
-f1
-0215000000
-DROP PROCEDURE IF EXISTS sp53;
-CREATE PROCEDURE sp53( f1 mediumint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp53(-8388600);
-f1
--8388598
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp54;
-CREATE PROCEDURE sp54( f1 mediumint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp54(16777201);
-f1
-16777202
-DROP PROCEDURE IF EXISTS sp55;
-CREATE PROCEDURE sp55( f1 mediumint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp55(16777210);
-f1
-16777210
-DROP PROCEDURE IF EXISTS sp56;
-CREATE PROCEDURE sp56( f1 mediumint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp56(-8388601);
-f1
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp57;
-CREATE PROCEDURE sp57( f1 numeric)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp57(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp58;
-CREATE PROCEDURE sp58( f1 numeric (0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp58(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp59;
-CREATE PROCEDURE sp59( f1 numeric (0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp59(9999999999);
-f1
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp60;
-CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp60(99999999);
-f1
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp61;
-CREATE PROCEDURE sp61( f1 numeric (0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp61(-99999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp62;
-CREATE PROCEDURE sp62( f1 numeric (0, 0))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp62(-999999999);
-f1
--1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp63;
-CREATE PROCEDURE sp63( f1 numeric (0, 0) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp63(9999999999);
-f1
-9999999999
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp64;
-CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp64(99999999);
-f1
-0100000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp65;
-CREATE PROCEDURE sp65( f1 numeric (0, 0) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp65(-99999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp66_n;
-CREATE PROCEDURE sp66_n( f1 numeric (63, 30))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp66_n(-1e+36);
-f1
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp66_n( -1000000000000000000000000000000000000 );
-f1
--999999999999999999999999999999989.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp67_nu;
-CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp67_nu(1e+36);
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp67_nu( 1000000000000000000000000000000000000 );
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp68_nuz;
-CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp68_nuz(1e+36);
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp68_nuz( 1000000000000000000000000000000000000 );
-f1
-999999999999999999999999999999999.999999999999999999999999999999
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp69_n_z;
-CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp69_n_z(-1e+36);
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp69_n_z( -1000000000000000000000000000000000000 );
-f1
-000000000000000000000000000000010.000000000000000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp70_n;
-CREATE PROCEDURE sp70_n( f1 numeric (64))
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp70_n(-1e+40);
-f1
--10000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp70_n( -10000000000000000000000000000000000000000 );
-f1
--10000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp71_nu;
-CREATE PROCEDURE sp71_nu( f1 numeric (64) unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp71_nu(1.00e+40);
-f1
-10000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp71_nu( 10000000000000000000000000000000000000000 );
-f1
-10000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp72_nuz;
-CREATE PROCEDURE sp72_nuz( f1 numeric (64) unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp72_nuz(1.00e+40);
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp72_nuz( 10000000000000000000000000000000000000000 );
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp73_n_z;
-CREATE PROCEDURE sp73_n_z( f1 numeric (64) zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp73_n_z(1.00e+40);
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp73_n_z( 10000000000000000000000000000000000000000 );
-f1
-0000000000000000000000010000000000000000000000000000000000000000
-DROP PROCEDURE IF EXISTS sp74;
-CREATE PROCEDURE sp74( f1 numeric unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp74(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp75;
-CREATE PROCEDURE sp75( f1 numeric unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp75(999999999);
-f1
-1000000000
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp76;
-CREATE PROCEDURE sp76( f1 numeric zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp76(-999999999);
-f1
-0000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp77;
-CREATE PROCEDURE sp77( f1 real)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp77(1.1);
-f1
-1.1
-DROP PROCEDURE IF EXISTS sp78;
-CREATE PROCEDURE sp78( f1 real unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp78(1.1);
-f1
-10
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp79;
-CREATE PROCEDURE sp79( f1 real unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp79(1.1);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp80;
-CREATE PROCEDURE sp80( f1 real zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp80(1.1);
-f1
-0000000000000000000010
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp81;
-CREATE PROCEDURE sp81( f1 smallint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp81(-32701);
-f1
--32702
-DROP PROCEDURE IF EXISTS sp82;
-CREATE PROCEDURE sp82( f1 smallint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp82(65531);
-f1
-65532
-DROP PROCEDURE IF EXISTS sp83;
-CREATE PROCEDURE sp83( f1 smallint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp83(65531);
-f1
-65532
-DROP PROCEDURE IF EXISTS sp84;
-CREATE PROCEDURE sp84( f1 smallint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp84(-32601);
-f1
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp85;
-CREATE PROCEDURE sp85( f1 tinyint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp85(-115);
-f1
--116
-DROP PROCEDURE IF EXISTS sp86;
-CREATE PROCEDURE sp86( f1 tinyint unsigned)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp86(251);
-f1
-252
-DROP PROCEDURE IF EXISTS sp87;
-CREATE PROCEDURE sp87( f1 tinyint unsigned zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp87(201);
-f1
-202
-DROP PROCEDURE IF EXISTS sp88;
-CREATE PROCEDURE sp88( f1 tinyint zerofill)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-SELECT f1;
-END//
-CALL sp88(-101);
-f1
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp89;
-CREATE PROCEDURE sp89( f1 enum('1enum', '2enum'))
-BEGIN
-IF f1 = '1enum' THEN set f1 = '2enum'; ELSE set f1 = '1enum'; END IF;
-END//
-CALL sp89( '1enum');
-DROP PROCEDURE IF EXISTS sp90;
-CREATE PROCEDURE sp90( f1 set('1set', '2set'))
-BEGIN
-IF f1 = '1set' THEN set f1 = '2set'; ELSE set f1 = '1set'; END IF;
-END//
-CALL sp90( '1set');
-DROP PROCEDURE IF EXISTS sp91;
-CREATE PROCEDURE sp91( f1 date)
-BEGIN
-set f1 = adddate(f1, interval 31 day);
-SELECT f1;
-END//
-CALL sp91( '1997-12-31');
-f1
-1998-01-31
-DROP PROCEDURE IF EXISTS sp92;
-CREATE PROCEDURE sp92( f1 time)
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998');
-SELECT f1;
-END//
-CALL sp92( '23:59:59.999999');
-f1
-25:59:59
-DROP PROCEDURE IF EXISTS sp93;
-CREATE PROCEDURE sp93( f1 datetime)
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002');
-SELECT f1;
-END//
-CALL sp93('1997-12-31 23:59:59.999999');
-f1
-1998-01-02 01:01:00
-DROP PROCEDURE IF EXISTS sp94;
-CREATE PROCEDURE sp94( f1 char)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp94( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp95;
-CREATE PROCEDURE sp95( f1 char ascii)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp95( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp96;
-CREATE PROCEDURE sp96( f1 char binary)
-BEGIN
-set f1 = concat('a', f1);
-SELECT f1;
-END//
-CALL sp96( 'h');
-f1
-a
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-DROP PROCEDURE IF EXISTS sp97;
-CREATE PROCEDURE sp97( f1 longtext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp97( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp98;
-CREATE PROCEDURE sp98( f1 mediumtext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp98( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp99;
-CREATE PROCEDURE sp99( f1 text)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp99( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp100;
-CREATE PROCEDURE sp100( f1 tinytext)
-BEGIN
-set f1 = concat('hello', f1);
-SELECT f1;
-END//
-CALL sp100( 'world');
-f1
-helloworld
-DROP PROCEDURE IF EXISTS sp101;
-CREATE PROCEDURE sp101( f1 year)
-BEGIN
-set f1 = f1 + 10;
-SELECT f1;
-END//
-CALL sp101(51);
-f1
-2061
-DROP PROCEDURE IF EXISTS sp102;
-CREATE PROCEDURE sp102( f1 year(4))
-BEGIN
-set f1 = f1 + 51;
-SELECT f1;
-END//
-CALL sp102(1982);
-f1
-2033
-DROP PROCEDURE IF EXISTS sp103;
-CREATE PROCEDURE sp103( f1 geometrycollection)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp103('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp104;
-CREATE PROCEDURE sp104( f1 linestring)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp105;
-CREATE PROCEDURE sp105( f1 point)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp105('\0\0\0\0\0\0\0\0\0\0\0\0\04@\0\0\0\0\0\04@');
-f1
-
-DROP PROCEDURE IF EXISTS sp106;
-CREATE PROCEDURE sp106( f1 polygon)
-BEGIN
-set f1 = f1;
-SELECT f1;
-END//
-CALL sp106('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\04@\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0 @\0\0\0\0\0\0@\0\0\0\0\0\0@');
-f1
-
-DROP PROCEDURE IF EXISTS sp107;
-CREATE PROCEDURE sp107( f1 timestamp)
-BEGIN
-set f1 = now() + 0 + f1;
-SELECT f1;
-END//
-CALL sp107(2.00e+13);
-f1
-returned
-Warnings:
-returned 1265 Data truncated for column 'f1' at row 1
-USE db_storedproc;
-DROP DATABASE db1;
-DROP DATABASE IF EXISTS db1;
-CREATE DATABASE db1;
-USE db1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( in f1 year, inout f2 year, out f3 year, in f4 year,
-inout f5 year, out f6 year, in f7 year(4), inout f8 year(4),
-out f9 year(4), in f10 year(4), inout f11 year(4), out f12 year(4))
-BEGIN
-set f1 = f1 + 10; set f2 = f2 + 10; set f3 = f2 + 10;
-set f4 = f4 + 10; set f5 = f5 + 10; set f6 = f5 + 10;
-set f7 = f7 + 51; set f8 = f8 + 51; set f9 = f8 + 51;
-set f10 = f10 + 51; set f11 = f11 + 51; set f12 = f11 + 51;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute01;
-CREATE PROCEDURE spexecute01()
-BEGIN
-declare var1 year;
-declare var2 year;
-declare var3 year;
-declare var4 year;
-declare var5 year(4);
-declare var6 year(4);
-declare var7 year(4);
-declare var8 year(4);
-set var1 = 51;
-set var3 = 51;
-set var5 = 1982;
-set var7 = 1982;
-CALL sp1(51, var1, var2, 51, var3, var4, 1982, var5, var6, 1982, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute01();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2061 2061 2071 2061 2061 2071 2033 2033 2084 2033 2033 2084
-var1 var2 var3 var4 var5 var6 var7 var8
-2061 2071 2061 2071 2033 2084 2033 2084
-DROP PROCEDURE spexecute01;
-DROP PROCEDURE sp1;
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp2( in f1 text, inout f2 text, out f3 text, in f4 text, inout f5 text,
-out f6 text, in f7 tinytext, inout f8 tinytext, out f9 tinytext,
-in f10 tinytext, inout f11 tinytext, out f12 tinytext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute02;
-CREATE PROCEDURE spexecute02()
-BEGIN
-declare var1 text;
-declare var2 text;
-declare var3 text;
-declare var4 text;
-declare var5 tinytext;
-declare var6 tinytext;
-declare var7 tinytext;
-declare var8 tinytext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp2( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute02();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute02;
-DROP PROCEDURE sp2;
-DROP PROCEDURE IF EXISTS sp3;
-CREATE PROCEDURE sp3( in f1 char, inout f2 char, out f3 char, in f4 char ascii,
-inout f5 char ascii, out f6 char ascii, in f7 longtext,
-inout f8 longtext, out f9 longtext, in f10 mediumtext,
-inout f11 mediumtext, out f12 mediumtext)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f1);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f4);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f9);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute03;
-CREATE PROCEDURE spexecute03()
-BEGIN
-declare var1 char;
-declare var2 char;
-declare var3 char ascii;
-declare var4 char ascii;
-declare var5 longtext;
-declare var6 longtext;
-declare var7 mediumtext;
-declare var8 mediumtext;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp3( 'h', var1, var2, 'h', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute03();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a helloworld helloworld NULL helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a helloworld NULL helloworld hellohelloworld
-DROP PROCEDURE spexecute03;
-DROP PROCEDURE sp3;
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4( in f1 bigint, inout f2 bigint, out f3 bigint,
-in f4 bigint, inout f5 bigint, out f6 bigint,
-in f7 bigint, inout f8 bigint, out f9 bigint,
-in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute04;
-CREATE PROCEDURE spexecute04()
-BEGIN
-declare var1 bigint;
-declare var2 bigint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -9.22e+18;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp4(-9.22e+18, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute04();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-6744073709551616 6744073709551616 -9220000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute04;
-DROP PROCEDURE sp4;
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6( in f1 timestamp, inout f2 timestamp, out f3 timestamp, in f4 timestamp, inout f5 timestamp, out f6 timestamp, in f7 timestamp, inout f8 timestamp, out f9 timestamp, in f10 timestamp, inout f11 timestamp, out f12 timestamp)
-BEGIN
-set f1 = now() + 0 + f1; set f2 = now() + 0 + f2; set f3 = now() + 0 + f1;
-set f4 = now() + 0 + f4; set f5 = now() + 0 + f5; set f6 = now() + 0 + f5;
-set f7 = now() + 0 + f7; set f8 = now() + 0 + f8; set f9 = now() + 0 + f8;
-set f10 = now() + 0 + f10; set f11 = now() + 0 + f11; set f12 = now() + 0 + f11;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute06;
-CREATE PROCEDURE spexecute06()
-BEGIN
-declare var1 timestamp;
-declare var2 timestamp;
-declare var3 timestamp;
-declare var4 timestamp;
-declare var5 timestamp;
-declare var6 timestamp;
-declare var7 timestamp;
-declare var8 timestamp;
-set var1 = 2.00e+13;
-set var3 = 2.00e+13;
-set var5 = 2.00e+13;
-set var7 = 2.00e+13;
-CALL sp6(2.00e+13, var1, var2, 2.00e+13, var3, var4, 2.00e+13, var5, var6, 2.00e+13, var7, var8);
-END//
-CALL spexecute06();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-returned returned returned returned returned returned returned returned returned returned returned returned
-DROP PROCEDURE spexecute06;
-DROP PROCEDURE sp6;
-DROP PROCEDURE IF EXISTS sp07;
-CREATE PROCEDURE sp07( IN f1 BIGINT UNSIGNED,
-INOUT f2 BIGINT UNSIGNED,
-OUT f3 BIGINT UNSIGNED,
-IN f4 BIGINT,
-INOUT f5 BIGINT,
-OUT f6 BIGINT,
-IN f7 BIGINT,
-INOUT f8 BIGINT,
-OUT f9 BIGINT,
-IN f10 BIGINT,
-INOUT f11 BIGINT,
-OUT f12 BIGINT)
-BEGIN
-SELECT f1, f2, f3;
-SELECT f4, f5, f6;
-SELECT f7, f8, f9;
-SELECT f10, f11, f12;
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f3 * 2); set f3 = (f3 - 10); set f3 = (f3 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3;
-SELECT f4, f5, f6;
-SELECT f7, f8, f9;
-SELECT f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute07;
-CREATE PROCEDURE spexecute07()
-BEGIN
-declare var1 bigint unsigned;
-declare var2 bigint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.84e+19;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-SELECT var1, var2;
-SELECT var3, var4;
-SELECT var5, var6;
-SELECT var7, var8;
-CALL sp07( var1, var1, var2, var3, var3, var4,
-var5, var5, var6, var7, var7, var8 );
-SELECT var1, var2;
-SELECT var3, var4;
-SELECT var5, var6;
-SELECT var7, var8;
-END//
-CALL spexecute07();
-var1 var2
-18400000000000000000 NULL
-var3 var4
--9220000000000000000 NULL
-var5 var6
--9220000000000000000 NULL
-var7 var8
--9220000000000000000 NULL
-f1 f2 f3
-18400000000000000000 18400000000000000000 NULL
-f4 f5 f6
--9220000000000000000 -9220000000000000000 NULL
-f7 f8 f9
--9220000000000000000 -9220000000000000000 NULL
-f10 f11 f12
--9220000000000000000 -9220000000000000000 NULL
-f1 f2 f3
-18353255926290448384 18353255926290448384 18353255926290448384
-f4 f5 f6
--9220000000000000000 6744073709551616 6744073709551616
-f7 f8 f9
--9220000000000000000 6744073709551616 6744073709551616
-f10 f11 f12
--9220000000000000000 6744073709551616 6744073709551616
-var1 var2
-18353255926290448384 18353255926290448384
-var3 var4
-6744073709551616 6744073709551616
-var5 var6
-6744073709551616 6744073709551616
-var7 var8
-6744073709551616 6744073709551616
-DROP PROCEDURE spexecute07;
-DROP PROCEDURE sp07;
-DROP PROCEDURE IF EXISTS sp8;
-CREATE PROCEDURE sp8( in f1 bigint unsigned zerofill,
-inout f2 bigint unsigned zerofill,
-out f3 bigint unsigned zerofill,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute08;
-CREATE PROCEDURE spexecute08()
-BEGIN
-declare var1 bigint unsigned zerofill;
-declare var2 bigint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.84e+17;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp8(1.84e+17, var1, var2, -9.22e+18, var3, var4,
--9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute08();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00368000000000000000 00368000000000000000 00368000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00368000000000000000 00368000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute08;
-DROP PROCEDURE sp8;
-DROP PROCEDURE IF EXISTS sp9;
-CREATE PROCEDURE sp9( in f1 bigint zerofill,
-inout f2 bigint zerofill,
-out f3 bigint zerofill,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
-set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10);
-set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5;
-set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10);
-set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8;
-set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10);
-set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11;
-set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10);
-set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute09;
-CREATE PROCEDURE spexecute09()
-BEGIN
-declare var1 bigint zerofill;
-declare var2 bigint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -9.22e+15;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp9(-9.22e+15, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute09();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00000000000000000000 00000000000000000000 00000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00000000000000000000 00000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute09;
-DROP PROCEDURE sp9;
-DROP PROCEDURE IF EXISTS sp10;
-CREATE PROCEDURE sp10( in f1 decimal,
-inout f2 decimal,
-out f3 decimal,
-in f4 bigint,
-inout f5 bigint,
-out f6 bigint,
-in f7 bigint,
-inout f8 bigint,
-out f9 bigint,
-in f10 bigint,
-inout f11 bigint,
-out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute10;
-CREATE PROCEDURE spexecute10()
-BEGIN
-declare var1 decimal;
-declare var2 decimal;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp10(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute10();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute10;
-DROP PROCEDURE sp10;
-DROP PROCEDURE IF EXISTS sp11;
-CREATE PROCEDURE sp11( in f1 decimal (0), inout f2 decimal (0), out f3 decimal (0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute11;
-CREATE PROCEDURE spexecute11()
-BEGIN
-declare var1 decimal (0);
-declare var2 decimal (0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = --1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp11(--1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute11();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute11;
-DROP PROCEDURE sp11;
-DROP PROCEDURE IF EXISTS sp12;
-CREATE PROCEDURE sp12( in f1 decimal (0) unsigned, inout f2 decimal (0) unsigned, out f3 decimal (0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute12;
-CREATE PROCEDURE spexecute12()
-BEGIN
-declare var1 decimal (0) unsigned;
-declare var2 decimal (0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp12(99999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute12();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute12;
-DROP PROCEDURE sp12;
-DROP PROCEDURE IF EXISTS sp13;
-CREATE PROCEDURE sp13( in f1 decimal (0, 0) zerofill, inout f2 decimal (0, 0) zerofill, out f3 decimal (0, 0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute13;
-CREATE PROCEDURE spexecute13()
-BEGIN
-declare var1 decimal (0, 0) zerofill;
-declare var2 decimal (0, 0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp13(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute13();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute13;
-DROP PROCEDURE sp13;
-DROP PROCEDURE IF EXISTS sp14;
-CREATE PROCEDURE sp14( in f1 decimal (63, 30), inout f2 decimal (63, 30), out f3 decimal (63, 30), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f3 = f2;
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute14;
-CREATE PROCEDURE spexecute14()
-BEGIN
-declare var1 decimal (63, 30);
-declare var2 decimal (63, 30);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+21;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp14(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute14();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000000000000000.000000000000000000000000000000 -1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute14;
-DROP PROCEDURE sp14;
-DROP PROCEDURE IF EXISTS sp15;
-CREATE PROCEDURE sp15( in f1 double, inout f2 double, out f3 double, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute15;
-CREATE PROCEDURE spexecute15()
-BEGIN
-declare var1 double;
-declare var2 double;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp15(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute15();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute15;
-DROP PROCEDURE sp15;
-DROP PROCEDURE IF EXISTS sp16;
-CREATE PROCEDURE sp16( in f1 double zerofill, inout f2 double zerofill, out f3 double zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute16;
-CREATE PROCEDURE spexecute16()
-BEGIN
-declare var1 double zerofill;
-declare var2 double zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp16(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute16();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute16;
-DROP PROCEDURE sp16;
-DROP PROCEDURE IF EXISTS sp17;
-CREATE PROCEDURE sp17( in f1 double unsigned, inout f2 double unsigned, out f3 double unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute17;
-CREATE PROCEDURE spexecute17()
-BEGIN
-declare var1 double unsigned;
-declare var2 double unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp17(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute17();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute17;
-DROP PROCEDURE sp17;
-DROP PROCEDURE IF EXISTS sp18;
-CREATE PROCEDURE sp18( in f1 double unsigned zerofill, inout f2 double unsigned zerofill, out f3 double unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute18;
-CREATE PROCEDURE spexecute18()
-BEGIN
-declare var1 double unsigned zerofill;
-declare var2 double unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp18(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute18();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute18;
-DROP PROCEDURE sp18;
-DROP PROCEDURE IF EXISTS sp19;
-CREATE PROCEDURE sp19( in f1 float unsigned, inout f2 float unsigned, out f3 float unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute19;
-CREATE PROCEDURE spexecute19()
-BEGIN
-declare var1 float unsigned;
-declare var2 float unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp19(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute19();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute19;
-DROP PROCEDURE sp19;
-DROP PROCEDURE IF EXISTS sp20;
-CREATE PROCEDURE sp20( in f1 float unsigned zerofill, inout f2 float unsigned zerofill, out f3 float unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute20;
-CREATE PROCEDURE spexecute20()
-BEGIN
-declare var1 float unsigned zerofill;
-declare var2 float unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp20(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute20();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute20;
-DROP PROCEDURE sp20;
-DROP PROCEDURE IF EXISTS sp21;
-CREATE PROCEDURE sp21( in f1 float zerofill, inout f2 float zerofill, out f3 float zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute21;
-CREATE PROCEDURE spexecute21()
-BEGIN
-declare var1 float zerofill;
-declare var2 float zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp21(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute21();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute21;
-DROP PROCEDURE sp21;
-DROP PROCEDURE IF EXISTS sp22;
-CREATE PROCEDURE sp22( in f1 float(0), inout f2 float(0), out f3 float(0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute22;
-CREATE PROCEDURE spexecute22()
-BEGIN
-declare var1 float(0);
-declare var2 float(0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp22(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute22();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute22;
-DROP PROCEDURE sp22;
-DROP PROCEDURE IF EXISTS sp23;
-CREATE PROCEDURE sp23( in f1 numeric, inout f2 numeric, out f3 numeric, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute23;
-CREATE PROCEDURE spexecute23()
-BEGIN
-declare var1 numeric;
-declare var2 numeric;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp23(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute23();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute23;
-DROP PROCEDURE sp23;
-DROP PROCEDURE IF EXISTS sp24;
-CREATE PROCEDURE sp24( in f1 real, inout f2 real, out f3 real, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute24;
-CREATE PROCEDURE spexecute24()
-BEGIN
-declare var1 real;
-declare var2 real;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp24(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute24();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1.1 1.1 11.1 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1.1 11.1 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute24;
-DROP PROCEDURE sp24;
-DROP PROCEDURE IF EXISTS sp25;
-CREATE PROCEDURE sp25( in f1 smallint, inout f2 smallint, out f3 smallint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute25;
-CREATE PROCEDURE spexecute25()
-BEGIN
-declare var1 smallint;
-declare var2 smallint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32701;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp25(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute25();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32758 -32758 -32748 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32758 -32748 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute25;
-DROP PROCEDURE sp25;
-DROP PROCEDURE IF EXISTS sp26;
-CREATE PROCEDURE sp26( in f1 date, inout f2 date, out f3 date, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = adddate(f1, interval 31 day); set f2 = adddate(f2, interval 31 day); set f3 = adddate(f2, interval 31 day);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute26;
-CREATE PROCEDURE spexecute26()
-BEGIN
-declare var1 date;
-declare var2 date;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '1997-12-31';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp26( '1997-12-31', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute26();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-31 1998-01-31 1998-03-03 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-31 1998-03-03 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute26;
-DROP PROCEDURE sp26;
-DROP PROCEDURE IF EXISTS sp27;
-CREATE PROCEDURE sp27( in f1 time, inout f2 time, out f3 time, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = addtime(f1, '02:00:00.999998'); set f2 = addtime(f2, '02:00:00.999998'); set f3 = addtime(f2, '02:00:00.999998');
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute27;
-CREATE PROCEDURE spexecute27()
-BEGIN
-declare var1 time;
-declare var2 time;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '23:59:59.999999';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp27( '23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute27();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-25:59:59 25:59:59 27:59:59 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-25:59:59 27:59:59 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute27;
-DROP PROCEDURE sp27;
-DROP PROCEDURE IF EXISTS sp28;
-CREATE PROCEDURE sp28( in f1 datetime, inout f2 datetime, out f3 datetime, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = addtime(f1, '1 1:1:1.000002'); set f2 = addtime(f2, '1 1:1:1.000002'); set f3 = addtime(f1, '1 1:1:1.000002');
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute28;
-CREATE PROCEDURE spexecute28()
-BEGIN
-declare var1 datetime;
-declare var2 datetime;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = '1997-12-31 23:59:59.999999';
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp28('1997-12-31 23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute28();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-02 01:01:00 1998-01-02 01:01:00 1998-01-03 02:02:01 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-02 01:01:00 1998-01-03 02:02:01 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute28;
-DROP PROCEDURE sp28;
-DROP PROCEDURE IF EXISTS sp29;
-CREATE PROCEDURE sp29( in f1 float(0) unsigned, inout f2 float(0) unsigned, out f3 float(0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute29;
-CREATE PROCEDURE spexecute29()
-BEGIN
-declare var1 float(0) unsigned;
-declare var2 float(0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp29(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute29();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute29;
-DROP PROCEDURE sp29;
-DROP PROCEDURE IF EXISTS sp30;
-CREATE PROCEDURE sp30( in f1 float(0) zerofill, inout f2 float(0) zerofill, out f3 float(0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute30;
-CREATE PROCEDURE spexecute30()
-BEGIN
-declare var1 float(0) zerofill;
-declare var2 float(0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp30(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute30();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute30;
-DROP PROCEDURE sp30;
-DROP PROCEDURE IF EXISTS sp31;
-CREATE PROCEDURE sp31( in f1 float(23), inout f2 float(23), out f3 float(23), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute31;
-CREATE PROCEDURE spexecute31()
-BEGIN
-declare var1 float(23);
-declare var2 float(23);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp31(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute31();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute31;
-DROP PROCEDURE sp31;
-DROP PROCEDURE IF EXISTS sp32;
-CREATE PROCEDURE sp32( in f1 float(23) unsigned, inout f2 float(23) unsigned, out f3 float(23) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute32;
-CREATE PROCEDURE spexecute32()
-BEGIN
-declare var1 float(23) unsigned;
-declare var2 float(23) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp32(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute32();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute32;
-DROP PROCEDURE sp32;
-DROP PROCEDURE IF EXISTS sp33;
-CREATE PROCEDURE sp33( in f1 float(23) zerofill, inout f2 float(23) zerofill, out f3 float(23) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute33;
-CREATE PROCEDURE spexecute33()
-BEGIN
-declare var1 float(23) zerofill;
-declare var2 float(23) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp33(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute33();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute33;
-DROP PROCEDURE sp33;
-DROP PROCEDURE IF EXISTS sp34;
-CREATE PROCEDURE sp34( in f1 float(24), inout f2 float(24), out f3 float(24), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute34;
-CREATE PROCEDURE spexecute34()
-BEGIN
-declare var1 float(24);
-declare var2 float(24);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp34(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute34();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute34;
-DROP PROCEDURE sp34;
-DROP PROCEDURE IF EXISTS sp35;
-CREATE PROCEDURE sp35( in f1 float(24) unsigned, inout f2 float(24) unsigned, out f3 float(24) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute35;
-CREATE PROCEDURE spexecute35()
-BEGIN
-declare var1 float(24) unsigned;
-declare var2 float(24) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp35(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute35();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute35;
-DROP PROCEDURE sp35;
-DROP PROCEDURE IF EXISTS sp36;
-CREATE PROCEDURE sp36( in f1 float(24) zerofill, inout f2 float(24) zerofill, out f3 float(24) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute36;
-CREATE PROCEDURE spexecute36()
-BEGIN
-declare var1 float(24) zerofill;
-declare var2 float(24) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp36(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute36();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute36;
-DROP PROCEDURE sp36;
-DROP PROCEDURE IF EXISTS sp37;
-CREATE PROCEDURE sp37( in f1 float(53), inout f2 float(53), out f3 float(53), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute37;
-CREATE PROCEDURE spexecute37()
-BEGIN
-declare var1 float(53);
-declare var2 float(53);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp37(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute37();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute37;
-DROP PROCEDURE sp37;
-DROP PROCEDURE IF EXISTS sp38;
-CREATE PROCEDURE sp38( in f1 float(53) unsigned, inout f2 float(53) unsigned, out f3 float(53) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute38;
-CREATE PROCEDURE spexecute38()
-BEGIN
-declare var1 float(53) unsigned;
-declare var2 float(53) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp38(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute38();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute38;
-DROP PROCEDURE sp38;
-DROP PROCEDURE IF EXISTS sp39;
-CREATE PROCEDURE sp39( in f1 float(53) zerofill, inout f2 float(53) zerofill, out f3 float(53) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute39;
-CREATE PROCEDURE spexecute39()
-BEGIN
-declare var1 float(53) zerofill;
-declare var2 float(53) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp39(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute39();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute39;
-DROP PROCEDURE sp39;
-DROP PROCEDURE IF EXISTS sp40;
-CREATE PROCEDURE sp40( in f1 real unsigned, inout f2 real unsigned, out f3 real unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute40;
-CREATE PROCEDURE spexecute40()
-BEGIN
-declare var1 real unsigned;
-declare var2 real unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp40(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute40();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute40;
-DROP PROCEDURE sp40;
-DROP PROCEDURE IF EXISTS sp41;
-CREATE PROCEDURE sp41( in f1 real unsigned zerofill, inout f2 real unsigned zerofill, out f3 real unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute41;
-CREATE PROCEDURE spexecute41()
-BEGIN
-declare var1 real unsigned zerofill;
-declare var2 real unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp41(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute41();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute41;
-DROP PROCEDURE sp41;
-DROP PROCEDURE IF EXISTS sp42;
-CREATE PROCEDURE sp42( in f1 real zerofill, inout f2 real zerofill, out f3 real zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute42;
-CREATE PROCEDURE spexecute42()
-BEGIN
-declare var1 real zerofill;
-declare var2 real zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.1;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp42(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute42();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute42;
-DROP PROCEDURE sp42;
-DROP PROCEDURE IF EXISTS sp43;
-CREATE PROCEDURE sp43( in f1 numeric (0), inout f2 numeric (0), out f3 numeric (0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute43;
-CREATE PROCEDURE spexecute43()
-BEGIN
-declare var1 numeric (0);
-declare var2 numeric (0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp43(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute43();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute43;
-DROP PROCEDURE sp43;
-DROP PROCEDURE IF EXISTS sp44;
-CREATE PROCEDURE sp44( in f1 numeric (0) unsigned, inout f2 numeric (0) unsigned, out f3 numeric (0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute44;
-CREATE PROCEDURE spexecute44()
-BEGIN
-declare var1 numeric (0) unsigned;
-declare var2 numeric (0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp44(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute44();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute44;
-DROP PROCEDURE sp44;
-DROP PROCEDURE IF EXISTS sp45;
-CREATE PROCEDURE sp45( in f1 numeric (0) zerofill, inout f2 numeric (0) zerofill, out f3 numeric (0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute45;
-CREATE PROCEDURE spexecute45()
-BEGIN
-declare var1 numeric (0) zerofill;
-declare var2 numeric (0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp45(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute45();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute45;
-DROP PROCEDURE sp45;
-DROP PROCEDURE IF EXISTS sp46;
-CREATE PROCEDURE sp46( in f1 numeric (0, 0), inout f2 numeric (0, 0), out f3 numeric (0, 0), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute46;
-CREATE PROCEDURE spexecute46()
-BEGIN
-declare var1 numeric (0, 0);
-declare var2 numeric (0, 0);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp46(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute46();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute46;
-DROP PROCEDURE sp46;
-DROP PROCEDURE IF EXISTS sp47;
-CREATE PROCEDURE sp47( in f1 numeric (0, 0) unsigned, inout f2 numeric (0, 0) unsigned, out f3 numeric (0, 0) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute47;
-CREATE PROCEDURE spexecute47()
-BEGIN
-declare var1 numeric (0, 0) unsigned;
-declare var2 numeric (0, 0) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp47(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute47();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute47;
-DROP PROCEDURE sp47;
-DROP PROCEDURE IF EXISTS sp48;
-CREATE PROCEDURE sp48( in f1 numeric (0, 0) zerofill, inout f2 numeric (0, 0) zerofill, out f3 numeric (0, 0) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute48;
-CREATE PROCEDURE spexecute48()
-BEGIN
-declare var1 numeric (0, 0) zerofill;
-declare var2 numeric (0, 0) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp48(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute48();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute48;
-DROP PROCEDURE sp48;
-DROP PROCEDURE IF EXISTS sp49;
-CREATE PROCEDURE sp49( in f1 numeric unsigned, inout f2 numeric unsigned, out f3 numeric unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute49;
-CREATE PROCEDURE spexecute49()
-BEGIN
-declare var1 numeric unsigned;
-declare var2 numeric unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp49(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute49();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute49;
-DROP PROCEDURE sp49;
-DROP PROCEDURE IF EXISTS sp50;
-CREATE PROCEDURE sp50( in f1 numeric unsigned zerofill, inout f2 numeric unsigned zerofill, out f3 numeric unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute50;
-CREATE PROCEDURE spexecute50()
-BEGIN
-declare var1 numeric unsigned zerofill;
-declare var2 numeric unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 9999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp50(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute50();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute50;
-DROP PROCEDURE sp50;
-DROP PROCEDURE IF EXISTS sp51;
-CREATE PROCEDURE sp51( in f1 numeric zerofill, inout f2 numeric zerofill, out f3 numeric zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute51;
-CREATE PROCEDURE spexecute51()
-BEGIN
-declare var1 numeric zerofill;
-declare var2 numeric zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp51(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute51();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute51;
-DROP PROCEDURE sp51;
-DROP PROCEDURE IF EXISTS sp52;
-CREATE PROCEDURE sp52( in f1 numeric (63, 30), inout f2 numeric (63, 30), out f3 numeric (63, 30), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute52;
-CREATE PROCEDURE spexecute52()
-BEGIN
-declare var1 numeric (63, 30);
-declare var2 numeric (63, 30);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp52(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute52();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000.000000000000000000000000000000 -10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute52;
-DROP PROCEDURE sp52;
-DROP PROCEDURE IF EXISTS sp53;
-CREATE PROCEDURE sp53( in f1 numeric (64), inout f2 numeric (64), out f3 numeric (64), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute53;
-CREATE PROCEDURE spexecute53()
-BEGIN
-declare var1 numeric (64);
-declare var2 numeric (64);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp53(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute53();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute53;
-DROP PROCEDURE sp53;
-DROP PROCEDURE IF EXISTS sp54;
-CREATE PROCEDURE sp54( in f1 numeric (64) unsigned, inout f2 numeric (64) unsigned, out f3 numeric (64) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute54;
-CREATE PROCEDURE spexecute54()
-BEGIN
-declare var1 numeric (64) unsigned;
-declare var2 numeric (64) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp54(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute54();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute54;
-DROP PROCEDURE sp54;
-DROP PROCEDURE IF EXISTS sp55;
-CREATE PROCEDURE sp55( in f1 numeric (64) zerofill, inout f2 numeric (64) zerofill, out f3 numeric (64) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute55;
-CREATE PROCEDURE spexecute55()
-BEGIN
-declare var1 numeric (64) zerofill;
-declare var2 numeric (64) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp55(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute55();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute55;
-DROP PROCEDURE sp55;
-DROP PROCEDURE IF EXISTS sp56;
-CREATE PROCEDURE sp56( in f1 year, inout f2 year, out f3 year, in f4 year, inout f5 year, out f6 year, in f7 year, inout f8 year, out f9 year, in f10 year, inout f11 year, out f12 year)
-BEGIN
-set f1 = f1 + 10; set f2 = f2 + 10; set f3 = f2 + 10;
-set f4 = f4 + 10; set f5 = f5 + 10; set f6 = f5 + 10;
-set f7 = f7 + 10; set f8 = f8 + 10; set f9 = f8 + 10;
-set f10= f10+ 10; set f11 = f11 + 10; set f12 = f11 + 10;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute56;
-CREATE PROCEDURE spexecute56()
-BEGIN
-declare var1 year;
-declare var2 year;
-declare var3 year;
-declare var4 year;
-declare var5 year;
-declare var6 year;
-declare var7 year;
-declare var8 year;
-set var1 = 51;
-set var3 = 51;
-set var5 = 51;
-set var7 = 51;
-CALL sp56(51, var1, var2, 51, var3, var4, 51, var5, var6, 51, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute56();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2061 2061 2071 2061 2061 2071 2061 2061 2071 2061 2061 2071
-var1 var2 var3 var4 var5 var6 var7 var8
-2061 2071 2061 2071 2061 2071 2061 2071
-DROP PROCEDURE spexecute56;
-DROP PROCEDURE sp56;
-DROP PROCEDURE IF EXISTS sp57;
-CREATE PROCEDURE sp57( in f1 year(4), inout f2 year(4), out f3 year(4), in f4 year(4), inout f5 year(4), out f6 year(4), in f7 year(4), inout f8 year(4), out f9 year(4), in f10 year(4), inout f11 year(4), out f12 year(4))
-BEGIN
-set f1 = f1 + 51; set f2 = f2 + 51; set f3 = f2 + 51;
-set f4 = f4 + 51; set f5 = f5 + 51; set f6 = f5 + 51;
-set f7 = f7 + 51; set f8 = f8 + 51; set f9 = f8 + 51;
-set f10 = f10 + 51; set f11 = f11 + 51; set f12 = f11 + 51;
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute57;
-CREATE PROCEDURE spexecute57()
-BEGIN
-declare var1 year(4);
-declare var2 year(4);
-declare var3 year(4);
-declare var4 year(4);
-declare var5 year(4);
-declare var6 year(4);
-declare var7 year(4);
-declare var8 year(4);
-set var1 = 1982;
-set var3 = 1982;
-set var5 = 1982;
-set var7 = 1982;
-CALL sp57(1982, var1, var2, 1982, var3, var4, 1982, var5, var6, 1982, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute57();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-2033 2033 2084 2033 2033 2084 2033 2033 2084 2033 2033 2084
-var1 var2 var3 var4 var5 var6 var7 var8
-2033 2084 2033 2084 2033 2084 2033 2084
-DROP PROCEDURE spexecute57;
-DROP PROCEDURE sp57;
-DROP PROCEDURE IF EXISTS sp58;
-CREATE PROCEDURE sp58( in f1 text, inout f2 text, out f3 text, in f4 text, inout f5 text, out f6 text, in f7 text, inout f8 text, out f9 text, in f10 text, inout f11 text, out f12 text)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute58;
-CREATE PROCEDURE spexecute58()
-BEGIN
-declare var1 text;
-declare var2 text;
-declare var3 text;
-declare var4 text;
-declare var5 text;
-declare var6 text;
-declare var7 text;
-declare var8 text;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp58( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute58();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute58;
-DROP PROCEDURE sp58;
-DROP PROCEDURE IF EXISTS sp59;
-CREATE PROCEDURE sp59( in f1 tinytext, inout f2 tinytext, out f3 tinytext, in f4 tinytext, inout f5 tinytext, out f6 tinytext, in f7 tinytext, inout f8 tinytext, out f9 tinytext, in f10 tinytext, inout f11 tinytext, out f12 tinytext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute59;
-CREATE PROCEDURE spexecute59()
-BEGIN
-declare var1 tinytext;
-declare var2 tinytext;
-declare var3 tinytext;
-declare var4 tinytext;
-declare var5 tinytext;
-declare var6 tinytext;
-declare var7 tinytext;
-declare var8 tinytext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp59( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute59();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute59;
-DROP PROCEDURE sp59;
-DROP PROCEDURE IF EXISTS sp60;
-CREATE PROCEDURE sp60( in f1 char, inout f2 char, out f3 char, in f4 char, inout f5 char, out f6 char, in f7 char, inout f8 char, out f9 char, in f10 char, inout f11 char, out f12 char)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f1);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f5);
-set f7 = concat('a', f7); set f8 = concat('a', f8); set f9 = concat('a', f8);
-set f10 = concat('a', f10); set f11 = concat('a', f11); set f12 = concat('a', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute60;
-CREATE PROCEDURE spexecute60()
-BEGIN
-declare var1 char;
-declare var2 char;
-declare var3 char;
-declare var4 char;
-declare var5 char;
-declare var6 char;
-declare var7 char;
-declare var8 char;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'h';
-set var7 = 'h';
-CALL sp60( 'h', var1, var2, 'h', var3, var4, 'h', var5, var6, 'h', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute60();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a a a a a a a
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a a a a a
-DROP PROCEDURE spexecute60;
-DROP PROCEDURE sp60;
-DROP PROCEDURE IF EXISTS sp61;
-CREATE PROCEDURE sp61( in f1 char ascii, inout f2 char ascii, out f3 char ascii, in f4 char ascii, inout f5 char ascii, out f6 char ascii, in f7 char ascii, inout f8 char ascii, out f9 char ascii, in f10 char ascii, inout f11 char ascii, out f12 char ascii)
-BEGIN
-set f1 = concat('a', f1); set f2 = concat('a', f2); set f3 = concat('a', f2);
-set f4 = concat('a', f4); set f5 = concat('a', f5); set f6 = concat('a', f4);
-set f7 = concat('a', f7); set f8 = concat('a', f8); set f9 = concat('a', f9);
-set f10 = concat('a', f10); set f11 = concat('a', f11); set f12 = concat('a', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute61;
-CREATE PROCEDURE spexecute61()
-BEGIN
-declare var1 char ascii;
-declare var2 char ascii;
-declare var3 char ascii;
-declare var4 char ascii;
-declare var5 char ascii;
-declare var6 char ascii;
-declare var7 char ascii;
-declare var8 char ascii;
-set var1 = 'h';
-set var3 = 'h';
-set var5 = 'h';
-set var7 = 'h';
-CALL sp61( 'h', var1, var2, 'h', var3, var4, 'h', var5, var6, 'h', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute61();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-a a a a a a a a NULL a a a
-var1 var2 var3 var4 var5 var6 var7 var8
-a a a a a NULL a a
-DROP PROCEDURE spexecute61;
-DROP PROCEDURE sp61;
-DROP PROCEDURE IF EXISTS sp62;
-CREATE PROCEDURE sp62( in f1 longtext, inout f2 longtext, out f3 longtext, in f4 longtext, inout f5 longtext, out f6 longtext, in f7 longtext, inout f8 longtext, out f9 longtext, in f10 longtext, inout f11 longtext, out f12 longtext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f2);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute62;
-CREATE PROCEDURE spexecute62()
-BEGIN
-declare var1 longtext;
-declare var2 longtext;
-declare var3 longtext;
-declare var4 longtext;
-declare var5 longtext;
-declare var6 longtext;
-declare var7 longtext;
-declare var8 longtext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp62( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute62();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute62;
-DROP PROCEDURE sp62;
-DROP PROCEDURE IF EXISTS sp63;
-CREATE PROCEDURE sp63( in f1 mediumtext, inout f2 mediumtext, out f3 mediumtext, in f4 mediumtext, inout f5 mediumtext, out f6 mediumtext, in f7 mediumtext, inout f8 mediumtext, out f9 mediumtext, in f10 mediumtext, inout f11 mediumtext, out f12 mediumtext)
-BEGIN
-set f1 = concat('hello', f1); set f2 = concat('hello', f2); set f3 = concat('hello', f3);
-set f4 = concat('hello', f4); set f5 = concat('hello', f5); set f6 = concat('hello', f5);
-set f7 = concat('hello', f7); set f8 = concat('hello', f8); set f9 = concat('hello', f8);
-set f10 = concat('hello', f10); set f11 = concat('hello', f11); set f12 = concat('hello', f11);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute63;
-CREATE PROCEDURE spexecute63()
-BEGIN
-declare var1 mediumtext;
-declare var2 mediumtext;
-declare var3 mediumtext;
-declare var4 mediumtext;
-declare var5 mediumtext;
-declare var6 mediumtext;
-declare var7 mediumtext;
-declare var8 mediumtext;
-set var1 = 'world';
-set var3 = 'world';
-set var5 = 'world';
-set var7 = 'world';
-CALL sp63( 'world', var1, var2, 'world', var3, var4, 'world', var5, var6, 'world', var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute63();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-helloworld helloworld NULL helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld helloworld helloworld hellohelloworld
-var1 var2 var3 var4 var5 var6 var7 var8
-helloworld NULL helloworld hellohelloworld helloworld hellohelloworld helloworld hellohelloworld
-DROP PROCEDURE spexecute63;
-DROP PROCEDURE sp63;
-DROP PROCEDURE IF EXISTS sp64;
-CREATE PROCEDURE sp64( in f1 decimal, inout f2 decimal, out f3 decimal, in f4 decimal, inout f5 decimal, out f6 decimal, in f7 decimal, inout f8 decimal, out f9 decimal, in f10 decimal, inout f11 decimal, out f12 decimal)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f2 / 2); set f3 = (f2 * 2); set f3 = (f2 - 10); set f3 = (f2 + 10);
-set f4 = (f4 / 2); set f4 = (f4 * 2); set f4 = (f4 - 10); set f4 = (f4 + 10); set f5 = (f5 / 2); set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f5 / 2); set f6 = (f5 * 2); set f6 = (f5 - 10); set f6 = (f5 + 10);
-set f7 = (f7 / 2); set f7 = (f7 * 2); set f7 = (f7 - 10); set f7 = (f7 + 10); set f8 = (f8 / 2); set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f8 / 2); set f9 = (f8 * 2); set f9 = (f8 - 10); set f9 = (f8 + 10);
-set f10 = (f10 / 2); set f10 = (f10 * 2); set f10 = (f10 - 10); set f10 = (f10 + 10); set f11 = (f11 / 2); set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f11 / 2); set f12 = (f11 * 2); set f12 = (f11 - 10); set f12 = (f11 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute64;
-CREATE PROCEDURE spexecute64()
-BEGIN
-declare var1 decimal;
-declare var2 decimal;
-declare var3 decimal;
-declare var4 decimal;
-declare var5 decimal;
-declare var6 decimal;
-declare var7 decimal;
-declare var8 decimal;
-set var1 = --1.00e+09;
-set var3 = --1.00e+09;
-set var5 = --1.00e+09;
-set var7 = --1.00e+09;
-CALL sp64(--1.00e+09, var1, var2, --1.00e+09, var3, var4, --1.00e+09, var5, var6, --1.00e+09, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute64();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 1000000000 1000000000 1000000010 1000000000 1000000000 1000000010 1000000000 1000000000 1000000010
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 1000000000 1000000010 1000000000 1000000010 1000000000 1000000010
-DROP PROCEDURE spexecute64;
-DROP PROCEDURE sp64;
-DROP PROCEDURE IF EXISTS sp65;
-CREATE PROCEDURE sp65( in f1 decimal (0, 0) unsigned zerofill, inout f2 decimal (0, 0) unsigned zerofill, out f3 decimal (0, 0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute65;
-CREATE PROCEDURE spexecute65()
-BEGIN
-declare var1 decimal (0, 0) unsigned zerofill;
-declare var2 decimal (0, 0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 999999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp65(999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute65();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute65;
-DROP PROCEDURE sp65;
-DROP PROCEDURE IF EXISTS sp66;
-CREATE PROCEDURE sp66( in f1 decimal (63, 30) unsigned, inout f2 decimal (63, 30) unsigned, out f3 decimal (63, 30) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute66;
-CREATE PROCEDURE spexecute66()
-BEGIN
-declare var1 decimal (63, 30) unsigned;
-declare var2 decimal (63, 30) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+16;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp66(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute66();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10000000000000000.000000000000000000000000000000 10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute66;
-DROP PROCEDURE sp66;
-DROP PROCEDURE IF EXISTS sp67;
-CREATE PROCEDURE sp67( in f1 decimal (63, 30) unsigned zerofill, inout f2 decimal (63, 30) unsigned zerofill, out f3 decimal (63, 30) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute67;
-CREATE PROCEDURE spexecute67()
-BEGIN
-declare var1 decimal (63, 30) unsigned zerofill;
-declare var2 decimal (63, 30) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+16;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp67(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute67();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute67;
-DROP PROCEDURE sp67;
-DROP PROCEDURE IF EXISTS sp68;
-CREATE PROCEDURE sp68( in f1 decimal (63, 30) zerofill, inout f2 decimal (63, 30) zerofill, out f3 decimal (63, 30) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute68;
-CREATE PROCEDURE spexecute68()
-BEGIN
-declare var1 decimal (63, 30) zerofill;
-declare var2 decimal (63, 30) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+21;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp68(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute68();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute68;
-DROP PROCEDURE sp68;
-DROP PROCEDURE IF EXISTS sp69;
-CREATE PROCEDURE sp69( in f1 decimal (64), inout f2 decimal (64), out f3 decimal (64), in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute69;
-CREATE PROCEDURE spexecute69()
-BEGIN
-declare var1 decimal (64);
-declare var2 decimal (64);
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp69(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute69();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute69;
-DROP PROCEDURE sp69;
-DROP PROCEDURE IF EXISTS sp70;
-CREATE PROCEDURE sp70( in f1 decimal (64) unsigned, inout f2 decimal (64) unsigned, out f3 decimal (64) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute70;
-CREATE PROCEDURE spexecute70()
-BEGIN
-declare var1 decimal (64) unsigned;
-declare var2 decimal (64) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp70(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute70();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute70;
-DROP PROCEDURE sp70;
-DROP PROCEDURE IF EXISTS sp71;
-CREATE PROCEDURE sp71( in f1 decimal (64) unsigned zerofill, inout f2 decimal (64) unsigned zerofill, out f3 decimal (64) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute71;
-CREATE PROCEDURE spexecute71()
-BEGIN
-declare var1 decimal (64) unsigned zerofill;
-declare var2 decimal (64) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp71(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute71();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute71;
-DROP PROCEDURE sp71;
-DROP PROCEDURE IF EXISTS sp72;
-CREATE PROCEDURE sp72( in f1 decimal (64) zerofill, inout f2 decimal (64) zerofill, out f3 decimal (64) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute72;
-CREATE PROCEDURE spexecute72()
-BEGIN
-declare var1 decimal (64) zerofill;
-declare var2 decimal (64) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp72(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute72();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute72;
-DROP PROCEDURE sp72;
-DROP PROCEDURE IF EXISTS sp73;
-CREATE PROCEDURE sp73( in f1 decimal unsigned, inout f2 decimal unsigned, out f3 decimal unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute73;
-CREATE PROCEDURE spexecute73()
-BEGIN
-declare var1 decimal unsigned;
-declare var2 decimal unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp73(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute73();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute73;
-DROP PROCEDURE sp73;
-DROP PROCEDURE IF EXISTS sp74;
-CREATE PROCEDURE sp74( in f1 decimal unsigned zerofill, inout f2 decimal unsigned zerofill, out f3 decimal unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute74;
-CREATE PROCEDURE spexecute74()
-BEGIN
-declare var1 decimal unsigned zerofill;
-declare var2 decimal unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp74(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute74();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute74;
-DROP PROCEDURE sp74;
-DROP PROCEDURE IF EXISTS sp75;
-CREATE PROCEDURE sp75( in f1 decimal zerofill, inout f2 decimal zerofill, out f3 decimal zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute75;
-CREATE PROCEDURE spexecute75()
-BEGIN
-declare var1 decimal zerofill;
-declare var2 decimal zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp75(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute75();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute75;
-DROP PROCEDURE sp75;
-DROP PROCEDURE IF EXISTS sp76;
-CREATE PROCEDURE sp76( in f1 float(0) unsigned zerofill, inout f2 float(0) unsigned zerofill, out f3 float(0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute76;
-CREATE PROCEDURE spexecute76()
-BEGIN
-declare var1 float(0) unsigned zerofill;
-declare var2 float(0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp76(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute76();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute76;
-DROP PROCEDURE sp76;
-DROP PROCEDURE IF EXISTS sp77;
-CREATE PROCEDURE sp77( in f1 float(23) unsigned zerofill, inout f2 float(23) unsigned zerofill, out f3 float(23) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute77;
-CREATE PROCEDURE spexecute77()
-BEGIN
-declare var1 float(23) unsigned zerofill;
-declare var2 float(23) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp77(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute77();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute77;
-DROP PROCEDURE sp77;
-DROP PROCEDURE IF EXISTS sp78;
-CREATE PROCEDURE sp78( in f1 float(24) unsigned zerofill, inout f2 float(24) unsigned zerofill, out f3 float(24) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute78;
-CREATE PROCEDURE spexecute78()
-BEGIN
-declare var1 float(24) unsigned zerofill;
-declare var2 float(24) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp78(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute78();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute78;
-DROP PROCEDURE sp78;
-DROP PROCEDURE IF EXISTS sp79;
-CREATE PROCEDURE sp79( in f1 float(53) unsigned zerofill, inout f2 float(53) unsigned zerofill, out f3 float(53) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute79;
-CREATE PROCEDURE spexecute79()
-BEGIN
-declare var1 float(53) unsigned zerofill;
-declare var2 float(53) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+00;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp79(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute79();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute79;
-DROP PROCEDURE sp79;
-DROP PROCEDURE IF EXISTS sp80;
-CREATE PROCEDURE sp80( in f1 int, inout f2 int, out f3 int, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute80;
-CREATE PROCEDURE spexecute80()
-BEGIN
-declare var1 int;
-declare var2 int;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -2.15e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp80(-2.15e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute80();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--2147483638 -2147483638 -2147483628 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--2147483638 -2147483628 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute80;
-DROP PROCEDURE sp80;
-DROP PROCEDURE IF EXISTS sp81;
-CREATE PROCEDURE sp81( in f1 int unsigned, inout f2 int unsigned, out f3 int unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute81;
-CREATE PROCEDURE spexecute81()
-BEGIN
-declare var1 int unsigned;
-declare var2 int unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 4.29e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp81(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute81();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute81;
-DROP PROCEDURE sp81;
-DROP PROCEDURE IF EXISTS sp82;
-CREATE PROCEDURE sp82( in f1 int unsigned zerofill, inout f2 int unsigned zerofill, out f3 int unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute82;
-CREATE PROCEDURE spexecute82()
-BEGIN
-declare var1 int unsigned zerofill;
-declare var2 int unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 4.29e+09;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp82(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute82();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute82;
-DROP PROCEDURE sp82;
-DROP PROCEDURE IF EXISTS sp83;
-CREATE PROCEDURE sp83( in f1 int zerofill, inout f2 int zerofill, out f3 int zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute83;
-CREATE PROCEDURE spexecute83()
-BEGIN
-declare var1 int zerofill;
-declare var2 int zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 2.15e+08;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp83(2.15e+08, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute83();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0215000000 0215000000 0215000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0215000000 0215000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute83;
-DROP PROCEDURE sp83;
-DROP PROCEDURE IF EXISTS sp84;
-CREATE PROCEDURE sp84( in f1 mediumint, inout f2 mediumint, out f3 mediumint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute84;
-CREATE PROCEDURE spexecute84()
-BEGIN
-declare var1 mediumint;
-declare var2 mediumint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -8388600;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp84(-8388600, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute84();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--8388598 -8388598 -8388588 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--8388598 -8388588 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute84;
-DROP PROCEDURE sp84;
-DROP PROCEDURE IF EXISTS sp85;
-CREATE PROCEDURE sp85( in f1 mediumint unsigned, inout f2 mediumint unsigned, out f3 mediumint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute85;
-CREATE PROCEDURE spexecute85()
-BEGIN
-declare var1 mediumint unsigned;
-declare var2 mediumint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 16777201;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp85(16777201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute85();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777202 16777202 16777212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777202 16777212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute85;
-DROP PROCEDURE sp85;
-DROP PROCEDURE IF EXISTS sp86;
-CREATE PROCEDURE sp86( in f1 mediumint unsigned zerofill, inout f2 mediumint unsigned zerofill, out f3 mediumint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute86;
-CREATE PROCEDURE spexecute86()
-BEGIN
-declare var1 mediumint unsigned zerofill;
-declare var2 mediumint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 16777210;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp86(16777210, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute86();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777210 16777210 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777210 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute86;
-DROP PROCEDURE sp86;
-DROP PROCEDURE IF EXISTS sp87;
-CREATE PROCEDURE sp87( in f1 mediumint zerofill, inout f2 mediumint zerofill, out f3 mediumint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute87;
-CREATE PROCEDURE spexecute87()
-BEGIN
-declare var1 mediumint zerofill;
-declare var2 mediumint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -8388601;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp87(-8388601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute87();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777215 16777215 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777215 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute87;
-DROP PROCEDURE sp87;
-DROP PROCEDURE IF EXISTS sp88;
-CREATE PROCEDURE sp88( in f1 numeric (0) unsigned zerofill, inout f2 numeric (0) unsigned zerofill, out f3 numeric (0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute88;
-CREATE PROCEDURE spexecute88()
-BEGIN
-declare var1 numeric (0) unsigned zerofill;
-declare var2 numeric (0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp88(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute88();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute88;
-DROP PROCEDURE sp88;
-DROP PROCEDURE IF EXISTS sp89;
-CREATE PROCEDURE sp89( in f1 numeric (0, 0) unsigned zerofill, inout f2 numeric (0, 0) unsigned zerofill, out f3 numeric (0, 0) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute89;
-CREATE PROCEDURE spexecute89()
-BEGIN
-declare var1 numeric (0, 0) unsigned zerofill;
-declare var2 numeric (0, 0) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 99999999;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp89(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute89();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute89;
-DROP PROCEDURE sp89;
-DROP PROCEDURE IF EXISTS sp90;
-CREATE PROCEDURE sp90( in f1 numeric (63, 30) unsigned, inout f2 numeric (63, 30) unsigned, out f3 numeric (63, 30) unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute90;
-CREATE PROCEDURE spexecute90()
-BEGIN
-declare var1 numeric (63, 30) unsigned;
-declare var2 numeric (63, 30) unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp90(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute90();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000.000000000000000000000000000000 10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute90;
-DROP PROCEDURE sp90;
-DROP PROCEDURE IF EXISTS sp91;
-CREATE PROCEDURE sp91( in f1 numeric (63, 30) unsigned zerofill, inout f2 numeric (63, 30) unsigned zerofill, out f3 numeric (63, 30) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute91;
-CREATE PROCEDURE spexecute91()
-BEGIN
-declare var1 numeric (63, 30) unsigned zerofill;
-declare var2 numeric (63, 30) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp91(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute91();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000100000000000000000000.000000000000000000000000000000 000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute91;
-DROP PROCEDURE sp91;
-DROP PROCEDURE IF EXISTS sp92;
-CREATE PROCEDURE sp92( in f1 numeric (63, 30) zerofill, inout f2 numeric (63, 30) zerofill, out f3 numeric (63, 30) zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute92;
-CREATE PROCEDURE spexecute92()
-BEGIN
-declare var1 numeric (63, 30) zerofill;
-declare var2 numeric (63, 30) zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp92(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute92();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute92;
-DROP PROCEDURE sp92;
-DROP PROCEDURE IF EXISTS sp93;
-CREATE PROCEDURE sp93( in f1 numeric (64) unsigned zerofill, inout f2 numeric (64) unsigned zerofill, out f3 numeric (64) unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute93;
-CREATE PROCEDURE spexecute93()
-BEGIN
-declare var1 numeric (64) unsigned zerofill;
-declare var2 numeric (64) unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 1.00e+22;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp93(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute93();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute93;
-DROP PROCEDURE sp93;
-DROP PROCEDURE IF EXISTS sp94;
-CREATE PROCEDURE sp94( in f1 smallint, inout f2 smallint, out f3 smallint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute94;
-CREATE PROCEDURE spexecute94()
-BEGIN
-declare var1 smallint;
-declare var2 smallint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32701;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp94(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute94();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32702 -32702 -32692 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32702 -32692 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute94;
-DROP PROCEDURE sp94;
-DROP PROCEDURE IF EXISTS sp95;
-CREATE PROCEDURE sp95( in f1 smallint unsigned, inout f2 smallint unsigned, out f3 smallint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute95;
-CREATE PROCEDURE spexecute95()
-BEGIN
-declare var1 smallint unsigned;
-declare var2 smallint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 65531;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp95(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute95();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute95;
-DROP PROCEDURE sp95;
-DROP PROCEDURE IF EXISTS sp96;
-CREATE PROCEDURE sp96( in f1 smallint unsigned zerofill, inout f2 smallint unsigned zerofill, out f3 smallint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute96;
-CREATE PROCEDURE spexecute96()
-BEGIN
-declare var1 smallint unsigned zerofill;
-declare var2 smallint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 65531;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp96(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute96();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute96;
-DROP PROCEDURE sp96;
-DROP PROCEDURE IF EXISTS sp97;
-CREATE PROCEDURE sp97( in f1 smallint zerofill, inout f2 smallint zerofill, out f3 smallint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute97;
-CREATE PROCEDURE spexecute97()
-BEGIN
-declare var1 smallint zerofill;
-declare var2 smallint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -32601;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp97(-32601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute97();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65535 65535 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65535 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute97;
-DROP PROCEDURE sp97;
-DROP PROCEDURE IF EXISTS sp98;
-CREATE PROCEDURE sp98( in f1 tinyint, inout f2 tinyint, out f3 tinyint, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute98;
-CREATE PROCEDURE spexecute98()
-BEGIN
-declare var1 tinyint;
-declare var2 tinyint;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -115;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp98(-115, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute98();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--116 -116 -106 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--116 -106 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute98;
-DROP PROCEDURE sp98;
-DROP PROCEDURE IF EXISTS sp99;
-CREATE PROCEDURE sp99( in f1 tinyint unsigned, inout f2 tinyint unsigned, out f3 tinyint unsigned, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute99;
-CREATE PROCEDURE spexecute99()
-BEGIN
-declare var1 tinyint unsigned;
-declare var2 tinyint unsigned;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 251;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp99(251, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute99();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-252 252 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-252 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute99;
-DROP PROCEDURE sp99;
-DROP PROCEDURE IF EXISTS sp100;
-CREATE PROCEDURE sp100( in f1 tinyint unsigned zerofill, inout f2 tinyint unsigned zerofill, out f3 tinyint unsigned zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute100;
-CREATE PROCEDURE spexecute100()
-BEGIN
-declare var1 tinyint unsigned zerofill;
-declare var2 tinyint unsigned zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = 201;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp100(201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute100();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-202 202 212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-202 212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute100;
-DROP PROCEDURE sp100;
-DROP PROCEDURE IF EXISTS sp101;
-CREATE PROCEDURE sp101( in f1 tinyint zerofill, inout f2 tinyint zerofill, out f3 tinyint zerofill, in f4 bigint, inout f5 bigint, out f6 bigint, in f7 bigint, inout f8 bigint, out f9 bigint, in f10 bigint, inout f11 bigint, out f12 bigint)
-BEGIN
-set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); set f2 = (f2 / 2); set f2 = (f2 * 2); set f2 = (f2 - 10); set f2 = (f2 + 10); set f3 = (f1 / 2); set f3 = (f1 * 2); set f3 = (f1 - 10); set f3 = (f1 + 10);
-set f6 = f5; set f5 = (f5 * 2); set f5 = (f5 - 10); set f5 = (f5 + 10); set f6 = (f6 * 2); set f6 = (f6 - 10); set f6 = (f6 + 10);
-set f9 = f8; set f8 = (f8 * 2); set f8 = (f8 - 10); set f8 = (f8 + 10); set f9 = (f9 * 2); set f9 = (f9 - 10); set f9 = (f9 + 10);
-set f12 = f11; set f11 = (f11 * 2); set f11 = (f11 - 10); set f11 = (f11 + 10); set f12 = (f12 * 2); set f12 = (f12 - 10); set f12 = (f12 + 10);
-SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12;
-END//
-DROP PROCEDURE IF EXISTS spexecute101;
-CREATE PROCEDURE spexecute101()
-BEGIN
-declare var1 tinyint zerofill;
-declare var2 tinyint zerofill;
-declare var3 bigint;
-declare var4 bigint;
-declare var5 bigint;
-declare var6 bigint;
-declare var7 bigint;
-declare var8 bigint;
-set var1 = -101;
-set var3 = -9.22e+18;
-set var5 = -9.22e+18;
-set var7 = -9.22e+18;
-CALL sp101(-101, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+18, var7, var8);
-SELECT var1, var2, var3, var4, var5, var6, var7, var8;
-END//
-CALL spexecute101();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-255 255 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-255 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
-DROP PROCEDURE spexecute101;
-DROP PROCEDURE sp101;
-USE db_storedproc;
-DROP DATABASE db1;
-USE db_storedproc;
-
-Testcase 4.7.2:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for "allow_invalid_dates" server sql mode
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-drop table IF EXISTS temp_table;
-create table temp_table (f1 datetime);
-set @@sql_mode = 'allow_invalid_dates';
-CREATE PROCEDURE sp2 ()
-BEGIN
-declare a datetime;
-set a = '2005-03-14 01:01:02';
-insert into temp_table values(a);
-END//
-show CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 ALLOW_INVALID_DATES CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
-BEGIN
-declare a datetime;
-set a = '2005-03-14 01:01:02';
-insert into temp_table values(a);
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode = 'traditional';
-CALL sp2 ();
-SELECT * from temp_table;
-f1
-2005-03-14 01:01:02
-SELECT @@sql_mode;
-@@sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-DROP PROCEDURE sp2;
-drop table temp_table;
-
-Testcase 4.7.3:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for *high_not_precedence* server sql mode
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp3;
-set @@sql_mode = 'high_not_precedence';
-CREATE PROCEDURE sp3()
-BEGIN
-declare a int signed;
-declare b int unsigned;
-set a = -5;
-set b = 5;
-SELECT not 1 between a and b;
-END//
-show CREATE PROCEDURE sp3;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp3 HIGH_NOT_PRECEDENCE CREATE DEFINER=`root`@`localhost` PROCEDURE `sp3`()
-BEGIN
-declare a int signed;
-declare b int unsigned;
-set a = -5;
-set b = 5;
-SELECT not 1 between a and b;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-CALL sp3();
-not 1 between a and b
-1
-SELECT @@sql_mode;
-@@sql_mode
-
-DROP PROCEDURE sp3;
-
-Testcase 4.7.4:
-FIXME: a wrong testcase number and/or description has been detected here. This
-FIXME: needs to be checked to be sure where the missing testcase is located.
-.
-check for combination of server sql modes
-
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp4;
-set @@sql_mode = 'ansi, error_for_division_by_zero';
-ERROR 42000: Variable 'sql_mode' can't be set to the value of ' error_for_division_by_zero'
-set @@sql_mode = 'ansi,error_for_division_by_zero';
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO
-CREATE PROCEDURE sp4()
-BEGIN
-declare a int;
-declare b int;
-declare c int;
-set a = 0;
-set b = 1;
-set c = b/a;
-show warnings;
-END//
-show CREATE PROCEDURE sp4;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO CREATE DEFINER="root"@"localhost" PROCEDURE "sp4"()
-BEGIN
-declare a int;
-declare b int;
-declare c int;
-set a = 0;
-set b = 1;
-set c = b/a;
-show warnings;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-CALL sp4();
-Level Code Message
-Error 1365 Division by 0
-Warnings:
-Error 1365 Division by 0
-DROP PROCEDURE sp4;
-set @@sql_mode='';
-
-Section 3.1.8 - SHOW statement checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.8.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-DROP PROCEDURE IF EXISTS sp6a;
-DROP PROCEDURE IF EXISTS sp6b;
-DROP PROCEDURE IF EXISTS sp6c;
-CREATE PROCEDURE sp6a (i1 longtext, out i2 mediumint , inout i3 longblob, in i4 year, out i5 real)
-language sql
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-CREATE PROCEDURE sp6b (out i1 longtext, out i2 mediumint , out i3 longblob, out i4 year, out i5 real)
-deterministic
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-CREATE PROCEDURE sp6c (inout i1 longtext, inout i2 mediumint , inout i3 longblob, inout i4 year, inout i5 real) comment 'this is a comment'
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-show CREATE PROCEDURE sp6a;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6a CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6a`(i1 longtext, out i2 mediumint , inout i3 longblob, in i4 year, out i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-show CREATE PROCEDURE sp6b;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6b CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6b`(out i1 longtext, out i2 mediumint , out i3 longblob, out i4 year, out i5 real)
- DETERMINISTIC
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-show CREATE PROCEDURE sp6c;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6c CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6c`(inout i1 longtext, inout i2 mediumint , inout i3 longblob, inout i4 year, inout i5 real)
- COMMENT 'this is a comment'
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6a';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6a PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6b';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6b PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW PROCEDURE status like 'sp6c';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6c PROCEDURE root@localhost modified created DEFINER this is a comment latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6a;
-DROP PROCEDURE sp6b;
-DROP PROCEDURE sp6c;
-
-Testcase 4.8.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-SHOW CREATE FUNCTION sp6;
-ERROR 42000: FUNCTION sp6 does not exist
-DROP PROCEDURE sp6;
-
-Testcase 4.8.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE FUNCTION sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) returns longtext
-BEGIN
-set @x=i1;
-set @y=@x;
-return 0;
-END//
-show function status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION sp6;
-
-Testcase 4.8.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp7;
-show CREATE PROCEDURE sp7;
-ERROR 42000: PROCEDURE sp7 does not exist
-
-Testcase 4.8.6:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-show procedure status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.7:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-show CREATE PROCEDURE fn1;
-ERROR 42000: PROCEDURE fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 4.8.8:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-show procedure status like 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP FUNCTION fn1;
-
-Testcase 4.8.9:
---------------------------------------------------------------------------------
-
-Testcase 4.8.10:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 real) returns real
-BEGIN
-return i1;
-END//
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.11:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-show CREATE PROCEDURE fn1;
-ERROR 42000: PROCEDURE fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 4.8.12:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(x int) returns int
-BEGIN
-return x;
-END//
-DROP FUNCTION fn1;
-show CREATE FUNCTION fn1;
-ERROR 42000: FUNCTION fn1 does not exist
-
-Testcase 4.8.13:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS f1000;
-SHOW FUNCTION STATUS LIKE 'f1000';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.14:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-SELECT * from t8;
-END//
-show CREATE FUNCTION sp1;
-ERROR 42000: FUNCTION sp1 does not exist
-DROP PROCEDURE sp1;
-
-Testcase 4.8.15:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-show function status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-DROP PROCEDURE sp6;
-
-Testcase 4.8.16:
---------------------------------------------------------------------------------
-
-Testcase 4.8.17:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-alter procedure sp6 sql security invoker;
-alter procedure sp6 comment 'this is a new comment';
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created INVOKER this is a new comment latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.18:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-alter function fn1 sql security invoker;
-show create function fn1;
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-fn1 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
- SQL SECURITY INVOKER
-BEGIN
-return x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.19:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 longtext) returns longtext
-BEGIN
-return i1;
-END//
-alter function fn1 sql security invoker;
-alter function fn1 comment 'this is a function 3242#@%$#@';
-show function status like 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is a function 3242#@%$#@ latin1 latin1_swedish_ci latin1_swedish_ci
-DROP FUNCTION fn1;
-
-Testcase 4.8.20:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 int , i2 int)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-alter procedure sp6 comment 'this is simple';
-show CREATE PROCEDURE sp6;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp6 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp6`(i1 int , i2 int)
- COMMENT 'this is simple'
-BEGIN
-set @x=i1;
-set @y=@x;
-END latin1 latin1_swedish_ci latin1_swedish_ci
-DROP PROCEDURE sp6;
-
-Testcase 4.8.21:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 int, i2 int)
-BEGIN
-set @x=i1;
-set @y=@x;
-END//
-DROP PROCEDURE sp6;
-show CREATE PROCEDURE sp6;
-ERROR 42000: PROCEDURE sp6 does not exist
-
-Testcase 4.8.22:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x=i3;
-set @y=@x;
-END//
-DROP PROCEDURE sp6;
-SHOW PROCEDURE status like 'sp6';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Testcase 4.8.23:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (x int) returns int
-BEGIN
-return x;
-END//
-DROP FUNCTION fn1;
-show CREATE FUNCTION fn1;
-ERROR 42000: FUNCTION fn1 does not exist
-
-Testcase 4.8.24:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (i1 longtext) returns longtext
-BEGIN
-return i1;
-END//
-DROP FUNCTION fn1;
-SHOW FUNCTION STATUS LIKE 'fn1';
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-
-Section 3.1.9 - Routine body checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.9.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-SELECT * from t9 limit 0, 100;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
--4991 a_aaaaaaaaa -4991
--4992 a^aaaaaaaa -4992
--4993 agaaaaaaa -4993
--4994 afaaaaaa -4994
--4995 aeaaaaa -4995
--4996 adaaaa -4996
--4997 acaaa -4997
--4998 abaa -4998
--4999 aaa -4999
--5000 a` -5000
-DROP PROCEDURE sp6;
-
-Testcase 4.9.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-delete from res_t9;
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-f1 f2 f3
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i3;
-set @a = i5;
-set @y = @x;
-set @b = @a;
-insert into res_t9 values (@y, @a, 111);
-SELECT * from res_t9;
-update res_t9 set f2 = 1000 where f2 = 50;
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-30 50 111
-f1 f2 f3
-30 1000 111
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Testcase 4.9.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i1;
-set @y = i3;
-set @z = i5;
-set @a = @x;
-set @b = @y;
-set @c = @z;
-create table res_t9(f1 longtext, f2 longblob, f3 real);
-insert into res_t9 values (@a, @b, @c);
-SELECT * from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-10 30 50
-DROP PROCEDURE sp6;
-drop table IF EXISTS res_t9;
-
-Testcase 4.9.6:
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-SELECT * from t9 limit 0, 100;
-return i1;
-END//
-ERROR 0A000: Not allowed to return a result set from a function
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-Warnings:
-Note 1051 Unknown table 'res_t9'
-create table res_t9 (f1 int, f2 char(25), f3 int);
-insert into res_t9 values (10, 'abc', 20);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-delete from res_t9;
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-create table res_t9 (f1 longtext, f2 longblob, f3 real);
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-Warnings:
-Note 1051 Unknown table 'res_t9'
-create table res_t9 (f1 int, f2 char(25), f3 int);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-insert into res_t9 values (100, 'abc', 300);
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 int, f2 char(25), f3 int);
-insert into res_t9 values (10, 'abc', 20);
-CREATE FUNCTION fn1(i1 longtext) returns longtext
-BEGIN
-update res_t9 set f1 = 20;
-drop table res_t9;
-return i1;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-drop table res_t9;
-DROP FUNCTION IF EXISTS fn1;
-Warnings:
-Note 1305 FUNCTION fn1 does not exist
-
-Testcase 4.9.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp6;
-drop table IF EXISTS res_t9;
-create table res_t9 (f1 longtext, f2 longblob, f3 real);
-CREATE PROCEDURE sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-BEGIN
-set @x = i1;
-set @y = i3;
-set @z = i5;
-set @a = @x;
-set @b = @y;
-set @c = @z;
-insert into res_t9 values (@a, @b, @c);
-SELECT * from res_t9;
-create index index_1 on res_t9 (f1 (5));
-show index from res_t9;
-END//
-CALL sp6 (10, 20, 30, 40, 50);
-f1 f2 f3
-10 30 50
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-res_t9 1 index_1 1 f1 A NULL 5 NULL YES BTREE
-DROP PROCEDURE sp6;
-drop table res_t9;
-
-Section 3.1._ - :
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 4.11.1:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.2:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1305 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.3:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @xx=1;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for 1318 set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.4:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for 1305 set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1 ();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.5:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.6:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for 1318 set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.7:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.8:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.9:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @xx=1;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.10:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-set @x2=0;
-CALL sp1 (1);
-set @x=0;
-END//
-CALL h1 ();
-SELECT @x, @x2;
-@x @x2
-1 1
-DROP PROCEDURE h1;
-
-Testcase 4.11.11:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.12:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=x;
-END//
-CREATE PROCEDURE h1 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=0;
-CALL sp1 (1);
-set @x=1;
-SELECT @x, @x2;
-END//
-CALL h1 ();
-@x @x2
-1 1
-DROP PROCEDURE h1;
-DROP PROCEDURE sp1;
-
-Testcase 4.11.13:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-fetch cur1 into a, b;
-SELECT done;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.14:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-fetch cur1 into a, b;
-SELECT done;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.15:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-set @x=0;
-fetch cur1 into a, b;
-SELECT @x=1;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-@x=1
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.16:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-SELECT done;
-set @x=0;
-fetch cur1 into a, b;
-SELECT @x=1;
-if not done then
-insert into res_t2 values (a, b);
-END if;
-until done END repeat;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-@x=1
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.17:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate 'HY000' set done = 1;
-open cur1;
-SELECT done;
-fetch cur1 into a;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.18:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1328 set done = 1;
-open cur1;
-SELECT done;
-fetch cur1 into a;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.19:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate 'HY000' set done = 1;
-open cur1;
-SELECT done;
-set @x=0;
-fetch cur1 into a;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.20:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1328 set done = 1;
-open cur1;
-SELECT done;
-set @x=0;
-fetch cur1 into a;
-set @x=1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.21:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1325 set done = 1;
-open cur1;
-SELECT done;
-open cur1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-done
-1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.22:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1325 set done = 1;
-open cur1;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.23:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1325 set done = 1;
-open cur1;
-set @x=0;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.24:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '24000' set done = 1;
-open cur1;
-set @x=0;
-SELECT done;
-open cur1;
-set @x=1;
-SELECT done, @x;
-close cur1;
-END//
-CALL h1();
-done
-0
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.25:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1326 set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.26:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '24000' set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.27:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1326 set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.28:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '24000' set done = 1;
-set @x=0;
-fetch cur1 into a, b;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.29:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for 1339 set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.30:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare continue handler for sqlstate '20000' set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.31:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for 1339 set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-
-Testcase 4.11.32:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-drop table IF EXISTS res_t2;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-create table res_t2(y char, z char);
-CREATE PROCEDURE h1()
-BEGIN
-declare done int default 0;
-declare a, b char;
-declare cur1 cursor for SELECT w, x from res_t1;
-declare exit handler for sqlstate '20000' set done = 1;
-set @x=0;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-CALL h1();
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-DROP TABLE IF EXISTS res_t2;
-
-Testcase 4.11.33:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char, x char);
-insert into res_t1 values('a', 'b');
-insert into res_t1 values('c', 'd');
-CREATE PROCEDURE h1()
-BEGIN
-declare condname condition for sqlstate '20000';
-declare done int default 0;
-declare a, b char;
-declare condname condition for sqlstate '20000';
-declare cur1 cursor for SELECT w, x from t1;
-set @x=2;
-case @x
-when 1 then set @x=10;
-when 2 then set @x=11;
-END case;
-set @x=1;
-SELECT done, @x;
-END//
-ERROR 42000: Duplicate condition: condname
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.35:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-CREATE TABLE res_t1(w INT UNIQUE, x CHAR);
-insert into res_t1 values (1, 'a');
-CREATE PROCEDURE h1 ()
-begin1_label:BEGIN
-declare condname1 condition for sqlstate '020';
-declare condname2 condition for sqlstate 'wewe';
-declare condname3 condition for 9999;
-declare exit handler for sqlstate '020' set @var1 = 1;
-declare exit handler for sqlstate 'wewe'set @var1 = 1;
-declare exit handler for 9999 set @var1 = 1;
-set @var2 = 1;
-insert into res_t1 values (2, 'b');
-begin2_label: BEGIN
-declare continue handler for sqlstate '90000023' set @var3= 1;
-set @var4 = 1;
-insert into res_t1 values (3, 'c');
-END begin2_label;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '020'
-CREATE PROCEDURE h1 ()
-begin1_label:BEGIN
-declare condname1 condition for sqlstate '020';
-declare condname2 condition for sqlstate 'wewe';
-declare condname3 condition for 9999;
-set @var2 = 1;
-insert into res_t1 values (2, 'b');
-begin2_label: BEGIN
-declare continue handler for sqlstate '90000023' set @var3= 1;
-set @var4 = 1;
-insert into res_t1 values (3, 'c');
-END begin2_label;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '020'
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.36:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for condname1 set @x = 1;
-set x1 = 1;
-set x1 = 2;
-END;
-SELECT @x, x1;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-DROP PROCEDURE IF EXISTS h1;
-
-Testcase 4.11.40:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char unique, x char);
-insert into res_t1 values ('a', 'b');
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5 int default 0;
-declare condname1 condition for sqlstate '42000';
-declare condname2 condition for sqlstate '42000';
-declare continue handler for condname1 set x1 = 1;
-declare continue handler for condname1 set x2 = 1;
-declare exit handler for condname1 set x3 = 1;
-declare continue handler for condname2 set x4 = 1;
-declare exit handler for condname2 set x5 = 1;
-END//
-ERROR 42000: Duplicate handler declared in the same block
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-
-Testcase 4.11.41:
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for sqlstate '00000' set @x = 1;
-set x1 = 1;
-set x1 = 2;
-END;
-SELECT @x, x1;
-END//
-ERROR 42000: Bad SQLSTATE: '00000'
-CALL h1();
-ERROR 42000: PROCEDURE db_storedproc.h1 does not exist
-DROP PROCEDURE IF EXISTS h1;
-
-* Testcase 3.1.2.53 (4.11.42):
-* Ensure that a handler condition of sqlwarning takes the same action as a
-* handler condition defined with an sqlstate that begins with 01.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-CREATE PROCEDURE h1()
-BEGIN
-DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=1;
-insert into res_t1 values('xxx', 'yy');
-set @x=0;
-END//
-CALL h1();
-ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
-SELECT @done, @x;
-@done @x
-0 1
-CREATE TABLE res_t1(w CHAR, x CHAR);
-INSERT INTO res_t1 VALUES('a', 'b');
-INSERT INTO res_t1 VALUES('c', 'd');
-CALL h1();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-CREATE PROCEDURE h1()
-BEGIN
-DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=0;
-insert into res_t1 values('xxx', 'yy');
-set @x=1;
-END//
-CALL h1();
-ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
-SELECT @done, @x;
-@done @x
-0 0
-CREATE TABLE res_t1(w CHAR, x CHAR);
-INSERT INTO res_t1 VALUES('a', 'b');
-INSERT INTO res_t1 VALUES('c', 'd');
-CALL h1();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result.moved b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result.moved
deleted file mode 100644
index 07e219ab738..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result.moved
+++ /dev/null
@@ -1,371 +0,0 @@
-USE test;
-drop table if exists tb3 ;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
-into table tb3;
-
-Testcase: 3.5.1.1:
-------------------
-use test;
-Create trigger trg1_1 BEFORE INSERT
-on tb3 for each row set @test_before = 2, new.f142 = @test_before;
-Create trigger trg1_2 AFTER INSERT
-on tb3 for each row set @test_after = 6;
-Create trigger trg1_4 BEFORE UPDATE
-on tb3 for each row set @test_before = 27,
-new.f142 = @test_before,
-new.f122 = 'Before Update Trigger';
-Create trigger trg1_3 AFTER UPDATE
-on tb3 for each row set @test_after = '15';
-Create trigger trg1_5 BEFORE DELETE on tb3 for each row
-select count(*) into @test_before from tb3 as tr_tb3
-where f121 = 'Test 3.5.1.1';
-Create trigger trg1_6 AFTER DELETE on tb3 for each row
-select count(*) into @test_after from tb3 as tr_tb3
-where f121 = 'Test 3.5.1.1';
-set @test_before = 1;
-set @test_after = 5;
-select @test_before, @test_after;
-@test_before @test_after
-1 5
-Insert into tb3 (f121, f122, f142, f144, f134)
-values ('Test 3.5.1.1', 'First Row', @test_before, @test_after, 1);
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 First Row 2 0000000005 1
-select @test_before, @test_after;
-@test_before @test_after
-2 6
-set @test_before = 18;
-set @test_after = 8;
-select @test_before, @test_after;
-@test_before @test_after
-18 8
-Update tb3 set tb3.f122 = 'Update',
-tb3.f142 = @test_before,
-tb3.f144 = @test_after
-where tb3.f121 = 'Test 3.5.1.1';
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 Before Update Trigger 27 0000000008 1
-select @test_before, @test_after;
-@test_before @test_after
-27 15
-Insert into tb3 (f121, f122, f142, f144, f134)
-values ('Test 3.5.1.1', 'Second Row', 5, 6, 2);
-set @test_before = 0;
-set @test_after = 0;
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 Second Row 2 0000000006 2
-Test 3.5.1.1 Before Update Trigger 27 0000000008 1
-select @test_before, @test_after;
-@test_before @test_after
-0 0
-Delete from tb3 where f121 = 'Test 3.5.1.1' and f134 = 2;
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 Before Update Trigger 27 0000000008 1
-select @test_before, @test_after;
-@test_before @test_after
-2 1
-drop trigger trg1_1;
-drop trigger trg1_2;
-drop trigger trg1_3;
-drop trigger trg1_4;
-drop trigger trg1_5;
-drop trigger trg1_6;
-delete from tb3 where f121='Test 3.5.1.1';
-
-Testcase: 3.5.1.2:
-------------------
-Create trigger trg_1 after insert
-on tb3 for each statement set @x= 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'statement set @x= 1' at line 2
-drop trigger trg_1;
-
-Testcase 3.5.1.3:
------------------
-CREATE TRIGGER trg3_1 on tb3 BEFORE INSERT for each row set new.f120 = 't';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on tb3 BEFORE INSERT for each row set new.f120 = 't'' at line 1
-CREATE trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's'' at line 1
-CREATE TRIGGER trg3_3 Before DELETE on tb3 set @ret1 = 'test' for each row;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set @ret1 = 'test' for each row' at line 1
-CREATE TRIGGER trg3_4 DELETE AFTER on tb3 set @ret1 = 'test' for each row;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELETE AFTER on tb3 set @ret1 = 'test' for each row' at line 1
-CREATE for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test'' at line 1
-drop trigger trg3_1;
-drop trigger trg3_2;
-drop trigger trg3_3;
-drop trigger trg3_4;
-drop trigger trg3_5;
-
-Testcase: 3.5.1.5:
-------------------
-CREATE TRIGGER trg4_1 AFTER on tb3 for each row set new.f120 = 'e';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on tb3 for each row set new.f120 = 'e'' at line 1
-CREATE TRIGGER trg4_2 INSERT on tb3 for each set row new.f120 = 'f';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT on tb3 for each set row new.f120 = 'f'' at line 1
-CREATE TRIGGER trg4_3 BEFORE INSERT tb3 for each row set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tb3 for each row set new.f120 = 'g'' at line 1
-CREATE TRIGGER trg4_4 AFTER UPDATE on tb3 for each set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set new.f120 = 'g'' at line 1
-CREATE trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g'' at line 1
-CREATE TRIGGER trg4_6 BEFORE DELETE for each row set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for each row set new.f120 = 'g'' at line 1
-drop trigger trg4_1;
-drop trigger trg4_2;
-drop trigger trg4_3;
-drop trigger trg4_4;
-drop trigger trg4_5;
-drop trigger trg4_6;
-
-Testcase 3.5.1.6: - Need to fix
--------------------------------
-
-Testcase 3.5.1.7: - need to fix
--------------------------------
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table t1 (f1 int, f2 char(25),f3 int) engine=ndb;
-CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
-for each row set new.f3 = '14';
-CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
-BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
-ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
-CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
-BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
-insert into t1 (f2) values ('insert 3.5.1.7');
-select * from t1;
-f1 f2 f3
-NULL insert 3.5.1.7 14
-update t1 set f2='update 3.5.1.7';
-select * from t1;
-f1 f2 f3
-NULL update 3.5.1.7 42
-select trigger_name from information_schema.triggers order by trigger_name;
-trigger_name
-trg5_1
-trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
-drop trigger trg5_1;
-drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
-ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
-drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
-drop table t1;
-
-Testcase 3.5.1.8:
------------------
-CREATE TRIGGER trg12* before insert on tb3 for each row set new.f120 = 't';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER trigger before insert on tb3 for each row set new.f120 = 't';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER 100 before insert on tb3 for each row set new.f120 = 't';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '100 before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER @@view before insert on tb3 for each row set new.f120 = 't';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@@view before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER @name before insert on tb3 for each row set new.f120 = 't';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@name before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER tb3.trg6_1 BEFORE INSERT on test.tb3
-for each row set new.f120 ='X';
-ERROR HY000: Trigger in wrong schema
-drop database if exists trig_db;
-create database trig_db;
-use trig_db;
-create table t1 (f1 integer) engine = ndb;
-use test;
-CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
-for each row set @ret_trg6_2 = 5;
-ERROR 42S02: Table 'trig_db.tb3' doesn't exist
-use trig_db;
-CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
-for each row set @ret_trg6_3 = 18;
-ERROR HY000: Trigger in wrong schema
-use test;
-drop database trig_db;
-drop trigger trg6_1;
-drop trigger trg6_3;
-
-Testcase 3.5.1.9:(cannot be inplemented at this point)
-------------------------------------------------------
-
-Testcase 3.5.1.10:
-------------------
-CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
-CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
-ERROR HY000: Trigger already exists
-drop trigger trg7_1;
-
-Testcase 3.5.1.?:
------------------
-drop table if exists t1;
-drop table if exists t2;
-create table t1 (f1 char(50), f2 integer) engine = ndb;
-create table t2 (f1 char(50), f2 integer) engine = ndb;
-create trigger trig before insert on t1
-for each row set new.f1 ='trig t1';
-create trigger trig before update on t2
-for each row set new.f1 ='trig t2';
-ERROR HY000: Trigger already exists
-insert into t1 value ('insert to t1',1);
-select * from t1;
-f1 f2
-trig t1 1
-update t1 set f1='update to t1';
-select * from t1;
-f1 f2
-update to t1 1
-insert into t2 value ('insert to t2',2);
-update t2 set f1='update to t1';
-select * from t2;
-f1 f2
-update to t1 2
-drop table t1;
-drop table t2;
-drop trigger trig;
-
-Testcase 3.5.1.11:
-------------------
-drop database if exists trig_db1;
-drop database if exists trig_db2;
-drop database if exists trig_db3;
-create database trig_db1;
-create database trig_db2;
-create database trig_db3;
-use trig_db1;
-create table t1 (f1 char(50), f2 integer) engine = ndb;
-create trigger trig before insert on t1
-for each row set new.f1 ='trig1', @test_var1='trig1';
-use trig_db2;
-create table t2 (f1 char(50), f2 integer) engine = ndb;
-create trigger trig before insert on t2
-for each row set new.f1 ='trig2', @test_var2='trig2';
-use trig_db3;
-create table t1 (f1 char(50), f2 integer) engine = ndb;
-create trigger trig before insert on t1
-for each row set new.f1 ='trig3', @test_var3='trig3';
-set @test_var1= '', @test_var2= '', @test_var3= '';
-use trig_db1;
-insert into t1 (f1,f2) values ('insert to db1 t1',1);
-insert into trig_db1.t1 (f1,f2) values ('insert to db1 t1 from db1',2);
-insert into trig_db2.t2 (f1,f2) values ('insert to db2 t2 from db1',3);
-insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
-select @test_var1, @test_var2, @test_var3;
-@test_var1 @test_var2 @test_var3
-trig1 trig2 trig3
-select * from t1 order by f2;
-f1 f2
-trig1 1
-trig1 2
-select * from trig_db2.t2;
-f1 f2
-trig2 3
-select * from trig_db3.t1;
-f1 f2
-trig3 4
-select * from t1 order by f2;
-f1 f2
-trig1 1
-trig1 2
-use test;
-drop database trig_db1;
-drop database trig_db2;
-drop database trig_db3;
-
-Testcase 3.5.2.1/2/3:
----------------------
-drop database if exists trig_db1;
-drop database if exists trig_db2;
-create database trig_db1;
-create database trig_db2;
-use trig_db1;
-create table t1 (f1 char(50), f2 integer) engine = ndb;
-create table trig_db2.t1 (f1 char(50), f2 integer) engine = ndb;
-create trigger trig1_b before insert on t1
-for each row set @test_var1='trig1_b';
-create trigger trig_db1.trig1_a after insert on t1
-for each row set @test_var2='trig1_a';
-create trigger trig_db2.trig2 before insert on trig_db2.t1
-for each row set @test_var3='trig2';
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers order by trigger_name;
-trigger_schema trigger_name event_object_table
-trig_db1 trig1_a t1
-trig_db1 trig1_b t1
-trig_db2 trig2 t1
-set @test_var1= '', @test_var2= '', @test_var3= '';
-insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
-insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
-select @test_var1, @test_var2, @test_var3;
-@test_var1 @test_var2 @test_var3
-trig1_b trig1_a trig2
-drop database trig_db1;
-drop database trig_db2;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03.result.moved b/mysql-test/suite/funcs_1/r/ndb_trig_03.result.moved
deleted file mode 100644
index 8f935113997..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03.result.moved
+++ /dev/null
@@ -1,702 +0,0 @@
-USE test;
-drop table if exists tb3 ;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
-into table tb3;
-
-Testcase 3.5.3:
----------------
-drop database if exists priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-
-Testcase 3.5.3.2/6:
--------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant ALL on *.* to test_noprivs@localhost;
-revoke TRIGGER on *.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-
-Testcase 3.5.3.2:
------------------
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.2_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.2-no');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.2_2-yes';
-select current_user;
-current_user
-root@localhost
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.2-yes');
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
-insert into t1 (f1) values ('insert 3.5.3.2-yes');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-trig 3.5.3.2_2-yes
-
-Testcase 3.5.3.6:
------------------
-use priv_db;
-drop trigger trg1_2;
-ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.6-yes');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-use priv_db;
-drop trigger trg1_2;
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.6-no');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-drop trigger trg1_2;
-
-Testcase 3.5.3.7a:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant ALL on *.* to test_noprivs@localhost;
-revoke UPDATE on *.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-show grants;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-create trigger trg4a_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1a';
-insert into t1 (f1) values ('insert 3.5.3.7-1a');
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-drop trigger trg4a_1;
-use priv_db;
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants;
-Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create trigger trg4a_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2a';
-insert into t1 (f1) values ('insert 3.5.3.7-2b');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-drop trigger trg4a_2;
-
-Testcase 3.5.3.7b:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs;
-grant ALL on priv_db.* to test_noprivs@localhost;
-revoke UPDATE on priv_db.* from test_noprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant UPDATE on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-show grants;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg4b_1 before UPDATE on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1b';
-insert into t1 (f1) values ('insert 3.5.3.7-1b');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-drop trigger trg4b_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg4b_2 before UPDATE on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2b';
-insert into t1 (f1) values ('insert 3.5.3.7-2b');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-insert 3.5.3.7-2b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-drop trigger trg4b_2;
-
-Testcase 3.5.3.7c
------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant ALL on priv_db.t1 to test_noprivs@localhost;
-revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg4c_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1c';
-insert into t1 (f1) values ('insert 3.5.3.7-1c');
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-drop trigger trg4c_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg4c_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2c';
-insert into t1 (f1) values ('insert 3.5.3.7-2c');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-trig 3.5.3.7-2c
-drop trigger trg4c_2;
-
-Testcase 3.5.3.7d:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg4d_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1d';
-insert into t1 (f1) values ('insert 3.5.3.7-1d');
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-trig 3.5.3.7-2c
-drop trigger trg4d_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg4d_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2d';
-insert into t1 (f1) values ('insert 3.5.3.7-2d');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-trig 3.5.3.7-2c
-trig 3.5.3.7-2d
-drop trigger trg4d_2;
-
-Testcase 3.5.3.8a:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant ALL on *.* to test_noprivs@localhost;
-revoke SELECT on *.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-show grants;
-Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create trigger trg5a_1 before INSERT on t1 for each row
-set @test_var = new.f1;
-set @test_var = 'before trig 3.5.3.8-1a';
-select @test_var;
-@test_var
-before trig 3.5.3.8-1a
-insert into t1 (f1) values ('insert 3.5.3.8-1a');
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1a
-drop trigger trg5a_1;
-use priv_db;
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants;
-Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create trigger trg5a_2 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-2a';
-select @test_var;
-@test_var
-before trig 3.5.3.8-2a
-insert into t1 (f1) values ('insert 3.5.3.8-2a');
-select @test_var;
-@test_var
-insert 3.5.3.8-2a
-drop trigger trg5a_2;
-
-Testcase: 3.5.3.8b
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant ALL on priv_db.* to test_noprivs@localhost;
-revoke SELECT on priv_db.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg5b_1 before UPDATE on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-1b';
-insert into t1 (f1) values ('insert 3.5.3.8-1b');
-select @test_var;
-@test_var
-before trig 3.5.3.8-1b
-update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1b
-drop trigger trg5b_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg5b_2 before UPDATE on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-2b';
-insert into t1 (f1) values ('insert 3.5.3.8-2b');
-select @test_var;
-@test_var
-before trig 3.5.3.8-2b
-update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
-select @test_var;
-@test_var
-update 3.5.3.8-2b
-drop trigger trg5b_2;
-
-Testcase 3.5.3.8c:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant ALL on priv_db.t1 to test_noprivs@localhost;
-revoke SELECT on priv_db.t1 from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg5c_1 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-1c';
-insert into t1 (f1) values ('insert 3.5.3.8-1c');
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1c
-drop trigger trg5c_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg5c_2 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var='before trig 3.5.3.8-2c';
-insert into t1 (f1) values ('insert 3.5.3.8-2c');
-select @test_var;
-@test_var
-insert 3.5.3.8-2c
-drop trigger trg5c_2;
-
-Testcase: 3.5.3.8d:
--------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg5d_1 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var='before trig 3.5.3.8-1d';
-insert into t1 (f1) values ('insert 3.5.3.8-1d');
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1d
-drop trigger trg5d_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg5d_2 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var='before trig 3.5.3.8-2d';
-insert into t1 (f1) values ('insert 3.5.3.8-2d');
-select @test_var;
-@test_var
-insert 3.5.3.8-2d
-drop trigger trg5d_2;
-
-Testcase: 3.5.3.x:
-------------------
-use priv_db;
-drop table if exists t1;
-drop table if exists t2;
-create table t1 (f1 int) engine= ndb;
-create table t2 (f2 int) engine= ndb;
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
-grant SELECT on priv_db.t2 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1 before insert on t1 for each row
-insert into t2 values (new.f1);
-use priv_db;
-insert into t1 (f1) values (4);
-ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
-grant INSERT on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (4);
-select f1 from t1 order by f1;
-f1
-4
-select f2 from t2 order by f2;
-f2
-4
-use priv_db;
-drop trigger trg1;
-create trigger trg2 before insert on t1 for each row
-update t2 set f2=new.f1-1;
-use priv_db;
-insert into t1 (f1) values (2);
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
-grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (2);
-select f1 from t1 order by f1;
-f1
-2
-4
-select f2 from t2 order by f2;
-f2
-1
-use priv_db;
-drop trigger trg2;
-create trigger trg3 before insert on t1 for each row
-select f2 into @aaa from t2 where f2=new.f1;
-use priv_db;
-insert into t1 (f1) values (1);
-ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
-grant SELECT on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (1);
-select f1 from t1 order by f1;
-f1
-1
-2
-4
-select f2 from t2 order by f2;
-f2
-1
-select @aaa;
-@aaa
-1
-use priv_db;
-drop trigger trg3;
-create trigger trg4 before insert on t1 for each row
-delete from t2;
-use priv_db;
-insert into t1 (f1) values (1);
-ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
-grant DELETE on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (1);
-select f1 from t1 order by f1;
-f1
-1
-1
-2
-4
-select f2 from t2 order by f2;
-f2
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
-drop user test_noprivs;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result.moved b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result.moved
deleted file mode 100644
index 9c278ee09b2..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result.moved
+++ /dev/null
@@ -1,482 +0,0 @@
-USE test;
-drop table if exists tb3 ;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
-into table tb3;
-
-Testcase: 3.5:
---------------
-create User test_general@localhost;
-set password for test_general@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
-create User test_super@localhost;
-set password for test_super@localhost = password('PWD');
-grant ALL on *.* to test_super@localhost with grant OPTION;
-connect(localhost,test_general,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_super,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-
-Testcase 3.5.4:
----------------
-use test;
-
-Testcase 3.5.4.1:
------------------
-create database db_drop;
-Use db_drop;
-create table t1 (f1 char(30)) engine=ndb;
-grant INSERT, SELECT on db_drop.t1 to test_general;
-Use db_drop;
-Create trigger trg1 BEFORE INSERT on t1
-for each row set new.f1='Trigger 3.5.4.1';
-Use db_drop;
-Insert into t1 values ('Insert error 3.5.4.1');
-Select * from t1 order by f1;
-f1
-Trigger 3.5.4.1
-drop trigger trg1;
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers order by trigger_name;
-trigger_schema trigger_name event_object_table
-Insert into t1 values ('Insert no trigger 3.5.4.1');
-Select * from t1 order by f1;
-f1
-Insert no trigger 3.5.4.1
-Trigger 3.5.4.1
-drop trigger trg1;
-drop database if exists db_drop;
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.4.2:
------------------
-create database db_drop2;
-Use db_drop2;
-drop table if exists t1_432 ;
-create table t1_432 (f1 char (30)) engine=ndb;
-Drop trigger tr_does_not_exit;
-ERROR HY000: Trigger does not exist
-drop table if exists t1_432 ;
-drop database if exists db_drop2;
-
-Testcase 3.5.4.3:
------------------
-create database db_drop3;
-Use db_drop3;
-drop table if exists t1_433 ;
-drop table if exists t1_433a ;
-create table t1_433 (f1 char (30)) engine=ndb;
-create table t1_433a (f1a char (5)) engine=ndb;
-CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
-set new.f1 = 'Trigger 3.5.4.3';
-Drop trigger t1.433.trg3;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.trg3' at line 1
-Drop trigger db_drop3.t1.433.trg3;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.433.trg3' at line 1
-Drop trigger mysql.trg3;
-ERROR HY000: Trigger does not exist
-Drop trigger tbx.trg3;
-ERROR HY000: Trigger does not exist
-Drop trigger db_drop3.trg3;
-drop table if exists t1_433;
-drop table if exists t1_433a;
-drop database if exists db_drop3;
-
-Testcase 3.5.4.4:
------------------
-create database db_drop4;
-Use db_drop4;
-create table t1 (f1 char(30)) engine=ndb;
-grant INSERT, SELECT on db_drop4.t1 to test_general;
-Create trigger trg4 BEFORE INSERT on t1
-for each row set new.f1='Trigger 3.5.4.4';
-Use db_drop4;
-Insert into t1 values ('Insert 3.5.4.4');
-Select * from t1;
-f1
-Trigger 3.5.4.4
-Drop database db_drop4;
-Show databases;
-Database
-information_schema
-mysql
-test
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers
-where information_schema.triggers.trigger_name='trg4';
-trigger_schema trigger_name event_object_table
-create database db_drop4;
-Use db_drop4;
-create table t1 (f1 char(30)) engine=ndb;
-grant INSERT, SELECT on db_drop4.t1 to test_general;
-Insert into t1 values ('2nd Insert 3.5.4.4');
-Select * from t1;
-f1
-2nd Insert 3.5.4.4
-drop trigger trg4;
-ERROR HY000: Trigger does not exist
-drop database if exists db_drop4;
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.4.5:
------------------
-create database db_drop5;
-Use db_drop5;
-create table t1 (f1 char(50)) engine=ndb;
-grant INSERT, SELECT on t1 to test_general;
-Create trigger trg5 BEFORE INSERT on t1
-for each row set new.f1='Trigger 3.5.4.5';
-Use db_drop5;
-Insert into t1 values ('Insert 3.5.4.5');
-Select * from t1;
-f1
-Trigger 3.5.4.5
-Drop table t1;
-Show tables;
-Tables_in_db_drop5
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers
-where information_schema.triggers.trigger_name='trg5';
-trigger_schema trigger_name event_object_table
-create table t1 (f1 char(50)) engine=ndb;
-grant INSERT, SELECT on t1 to test_general;
-Insert into t1 values ('2nd Insert 3.5.4.5');
-Select * from t1;
-f1
-2nd Insert 3.5.4.5
-drop trigger trg5;
-ERROR HY000: Trigger does not exist
-drop database if exists db_drop5;
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.5:
----------------
-use test;
-
-Testcase 3.5.5.1:
------------------
-Create trigger trg1 before INSERT on t100 for each row set new.f2=1000;
-ERROR 42S02: Table 'test.t100' doesn't exist
-
-Testcase 3.5.5.2:
------------------
-Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
-Create trigger trg2 before INSERT
-on t1_temp for each row set new.f2=9999;
-ERROR HY000: Trigger's 't1_temp' is view or temporary table
-drop table t1_temp;
-
-Testcase 3.5.5.3:
------------------
-Create view vw3 as select f118 from tb3;
-Create trigger trg3 before INSERT
-on vw3 for each row set new.f118='s';
-ERROR HY000: 'test.vw3' is not BASE TABLE
-drop view vw3;
-
-Testcase 3.5.5.4:
------------------
-create database dbtest_one;
-create database dbtest_two;
-use dbtest_two;
-create table t2 (f1 char(15)) engine=ndb;
-use dbtest_one;
-create trigger trg4 before INSERT
-on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
-ERROR HY000: Trigger in wrong schema
-grant INSERT, SELECT on dbtest_two.t2 to test_general;
-grant SELECT on dbtest_one.* to test_general;
-use dbtest_two;
-Insert into t2 values ('1st Insert 3.5.5.4');
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-Select * from t2;
-f1
-1st Insert 3.5.
-use dbtest_one;
-Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-Select * from dbtest_two.t2 order by f1;
-f1
-1st Insert 3.5.
-2nd Insert 3.5.
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-DROP DATABASE if exists dbtest_one;
-drop database if EXISTS dbtest_two;
-
-Testcase 3.5.6:
----------------
-use test;
-
-Testcase 3.5.6.1 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.6.2 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.6.3:
------------------
-Create trigger trg3_1 DURING UPDATE on tb3 for each row set new.f132=25;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DURING UPDATE on tb3 for each row set new.f132=25' at line 1
-Create trigger trg3_2 TIME INSERT on tb3 for each row set new.f132=15;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TIME INSERT on tb3 for each row set new.f132=15' at line 1
-drop trigger tb3.trg3_1;
-drop trigger tb3.trg3_2;
-
-Testcase 3.5.6.4 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.6.5 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.1 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.2 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.3 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.4:
------------------
-Create trigger trg4_1 BEFORE SELECT on tb3 for each row set new.f132=5;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT on tb3 for each row set new.f132=5' at line 1
-Create trigger trg4_2 AFTER VALUE on tb3 for each row set new.f132=1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUE on tb3 for each row set new.f132=1' at line 1
-drop trigger tb3.trg4_1;
-drop trigger tb3.trg4_2;
-
-Testcase 3.5.7.5 / 3.5.7.6:
----------------------------
-Create trigger trg5_1 BEFORE INSERT
-on tb3 for each row set new.f122='Trigger1 3.5.7.5/6';
-Create trigger trg5_2 BEFORE INSERT
-on tb3 for each row set new.f122='Trigger2 3.5.7.5';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-Insert into tb3 (f121,f122) values ('Test 3.5.7.5/6','Insert 3.5.7.5');
-Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
-f121 f122
-Test 3.5.7.5/6 Trigger1 3.5.7.5/6
-update tb3 set f122='Update 3.5.7.6' where f121= 'Test 3.5.7.5/6';
-Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
-f121 f122
-Test 3.5.7.5/6 Update 3.5.7.6
-drop trigger trg5_1;
-drop trigger trg5_2;
-delete from tb3 where f121='Test 3.5.7.5/6';
-
-Testcase 3.5.7.7 / 3.5.7.8:
----------------------------
-set @test_var='Before trig 3.5.7.7';
-Create trigger trg6_1 AFTER INSERT
-on tb3 for each row set @test_var='Trigger1 3.5.7.7/8';
-Create trigger trg6_2 AFTER INSERT
-on tb3 for each row set @test_var='Trigger2 3.5.7.7';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-select @test_var;
-@test_var
-Before trig 3.5.7.7
-Insert into tb3 (f121,f122) values ('Test 3.5.7.7/8','Insert 3.5.7.7');
-Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
-f121 f122
-Test 3.5.7.7/8 Insert 3.5.7.7
-select @test_var;
-@test_var
-Trigger1 3.5.7.7/8
-update tb3 set f122='Update 3.5.7.8' where f121= 'Test 3.5.7.7/8';
-Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
-f121 f122
-Test 3.5.7.7/8 Update 3.5.7.8
-select @test_var;
-@test_var
-Trigger1 3.5.7.7/8
-drop trigger trg6_1;
-drop trigger trg6_2;
-delete from tb3 where f121='Test 3.5.7.7/8';
-
-Testcase 3.5.7.9/10:
---------------------
-Create trigger trg7_1 BEFORE UPDATE
-on tb3 for each row set new.f122='Trigger1 3.5.7.9/10';
-Create trigger trg7_2 BEFORE UPDATE
-on tb3 for each row set new.f122='Trigger2 3.5.7.9';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-Insert into tb3 (f121,f122) values ('Test 3.5.7.9/10','Insert 3.5.7.9');
-Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
-f121 f122
-Test 3.5.7.9/10 Insert 3.5.7.9
-update tb3 set f122='update 3.5.7.10' where f121='Test 3.5.7.9/10';
-Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
-f121 f122
-Test 3.5.7.9/10 Trigger1 3.5.7.9/10
-drop trigger trg7_1;
-drop trigger trg7_2;
-delete from tb3 where f121='Test 3.5.7.9/10';
-
-Testcase 3.5.7.11/12:
----------------------
-set @test_var='Before trig 3.5.7.11';
-Create trigger trg8_1 AFTER UPDATE
-on tb3 for each row set @test_var='Trigger 3.5.7.11/12';
-Create trigger trg8_2 AFTER UPDATE
-on tb3 for each row set @test_var='Trigger2 3.5.7.11';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-select @test_var;
-@test_var
-Before trig 3.5.7.11
-Insert into tb3 (f121,f122) values ('Test 3.5.7.11/12','Insert 3.5.7.11/12');
-select @test_var;
-@test_var
-Before trig 3.5.7.11
-Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
-f121 f122
-Test 3.5.7.11/12 Insert 3.5.7.11/12
-update tb3 set f122='update 3.5.7.12' where f121='Test 3.5.7.11/12';
-Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
-f121 f122
-Test 3.5.7.11/12 update 3.5.7.12
-select @test_var;
-@test_var
-Trigger 3.5.7.11/12
-delete from tb3 where f121='Test 3.5.7.11/12';
-drop trigger trg8_1;
-drop trigger trg8_2;
-delete from tb3 where f121='Test 3.5.7.11/12';
-
-Testcase 3.5.7.13/14:
----------------------
-set @test_var=1;
-Create trigger trg9_1 BEFORE DELETE
-on tb3 for each row set @test_var=@test_var+1;
-Create trigger trg9_2 BEFORE DELETE
-on tb3 for each row set @test_var=@test_var+10;
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-select @test_var;
-@test_var
-1
-Insert into tb3 (f121,f122) values ('Test 3.5.7.13/14','Insert 3.5.7.13');
-Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
-f121 f122
-Test 3.5.7.13/14 Insert 3.5.7.13
-select @test_var;
-@test_var
-1
-delete from tb3 where f121='Test 3.5.7.13/14';
-Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
-f121 f122
-select @test_var;
-@test_var
-2
-delete from tb3 where f121='Test 3.5.7.13/14';
-select @test_var;
-@test_var
-2
-drop trigger trg9_1;
-drop trigger trg9_2;
-delete from tb3 where f121='Test 3.5.7.13/14';
-
-Testcase 3.5.7.15/16:
----------------------
-set @test_var=1;
-Create trigger trg_3_406010_1 AFTER DELETE
-on tb3 for each row set @test_var=@test_var+5;
-Create trigger trg_3_406010_2 AFTER DELETE
-on tb3 for each row set @test_var=@test_var+50;
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-Create trigger trg_3_406010_1 AFTER INSERT
-on tb3 for each row set @test_var=@test_var+1;
-ERROR HY000: Trigger already exists
-select @test_var;
-@test_var
-1
-Insert into tb3 (f121,f122) values ('Test 3.5.7.15/16','Insert 3.5.7.15/16');
-Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
-f121 f122
-Test 3.5.7.15/16 Insert 3.5.7.15/16
-select @test_var;
-@test_var
-1
-delete from tb3 where f121='Test 3.5.7.15/16';
-Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
-f121 f122
-select @test_var;
-@test_var
-6
-delete from tb3 where f121='Test 3.5.7.15/16';
-select @test_var;
-@test_var
-6
-drop trigger trg_3_406010_1;
-drop trigger trg_3_406010_2;
-delete from tb3 where f121='Test 3.5.7.15/16';
-
-Testcase 3.5.7.17 (see Testcase 3.5.1.1)
-----------------------------------------
-drop user test_general@localhost;
-drop user test_general;
-drop user test_super@localhost;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_08.result.moved b/mysql-test/suite/funcs_1/r/ndb_trig_08.result.moved
deleted file mode 100644
index 52a0407a940..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_08.result.moved
+++ /dev/null
@@ -1,538 +0,0 @@
-USE test;
-drop table if exists tb3 ;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
-into table tb3;
-
-Testcase: 3.5:
---------------
-create User test_general@localhost;
-set password for test_general@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
-create User test_super@localhost;
-set password for test_super@localhost = password('PWD');
-grant ALL on *.* to test_super@localhost with grant OPTION;
-connect(localhost,test_general,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-connect(localhost,test_super,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
-
-Testcase 3.5.8.1: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.8.2: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.8.3/4:
--------------------
-create database db_test;
-grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
-grant LOCK TABLES on db_test.* to test_general;
-Use db_test;
-create table t1_i (
-i120 char ascii not null DEFAULT b'101',
-i136 smallint zerofill not null DEFAULT 999,
-i144 int zerofill not null DEFAULT 99999,
-i163 decimal (63,30)) engine=ndb;
-create table t1_u (
-u120 char ascii not null DEFAULT b'101',
-u136 smallint zerofill not null DEFAULT 999,
-u144 int zerofill not null DEFAULT 99999,
-u163 decimal (63,30)) engine=ndb;
-create table t1_d (
-d120 char ascii not null DEFAULT b'101',
-d136 smallint zerofill not null DEFAULT 999,
-d144 int zerofill not null DEFAULT 99999,
-d163 decimal (63,30)) engine=ndb;
-Insert into t1_u values ('a',111,99999,999.99);
-Insert into t1_u values ('b',222,99999,999.99);
-Insert into t1_u values ('c',333,99999,999.99);
-Insert into t1_u values ('d',222,99999,999.99);
-Insert into t1_u values ('e',222,99999,999.99);
-Insert into t1_u values ('f',333,99999,999.99);
-Insert into t1_d values ('a',111,99999,999.99);
-Insert into t1_d values ('b',222,99999,999.99);
-Insert into t1_d values ('c',333,99999,999.99);
-Insert into t1_d values ('d',444,99999,999.99);
-Insert into t1_d values ('e',222,99999,999.99);
-Insert into t1_d values ('f',222,99999,999.99);
-
-3.5.8.4 - multiple SQL
-----------------------
-use test;
-Create trigger trg1 AFTER INSERT on tb3 for each row
-BEGIN
-insert into db_test.t1_i
-values (new.f120, new.f136, new.f144, new.f163);
-update db_test.t1_u
-set u144=new.f144, u163=new.f163
-where u136=new.f136;
-delete from db_test.t1_d where d136= new.f136;
-select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
-where u136= new.f136;
-END//
-Use test;
-set @test_var=0;
-Insert into tb3 (f120, f122, f136, f144, f163)
-values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
-Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
-f120 f122 f136 f144 f163
-1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_i;
-i120 i136 i144 i163
-1 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_u;
-u120 u136 u144 u163
-a 00111 0000099999 999.990000000000000000000000000000
-b 00222 0000023456 1.050000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-d 00222 0000023456 1.050000000000000000000000000000
-e 00222 0000023456 1.050000000000000000000000000000
-f 00333 0000099999 999.990000000000000000000000000000
-select * from db_test.t1_d;
-d120 d136 d144 d163
-a 00111 0000099999 999.990000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-d 00444 0000099999 999.990000000000000000000000000000
-select @test_var;
-@test_var
-3.150000000000000000000000000000
-
-3.5.8.4 - single SQL - insert
------------------------------
-Create trigger trg2 BEFORE UPDATE on tb3 for each row
-BEGIN
-insert into db_test.t1_i
-values (new.f120, new.f136, new.f144, new.f163);
-END//
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_i order by i120;
-i120 i136 i144 i163
-1 00222 0000023456 1.050000000000000000000000000000
-update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
- where f122='Test 3.5.8.4';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_i order by i120;
-i120 i136 i144 i163
-1 00222 0000023456 1.050000000000000000000000000000
-I 00222 0000023456 1.050000000000000000000000000000
-
-3.5.8.4 - single SQL - update
------------------------------
-drop trigger trg2;
-Create trigger trg3 BEFORE UPDATE on tb3 for each row
-update db_test.t1_u
-set u120=new.f120
-where u136=new.f136;
-update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
- where f122='Test 3.5.8.4-Single Insert';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_u order by u120;
-u120 u136 u144 u163
-a 00111 0000099999 999.990000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-f 00333 0000099999 999.990000000000000000000000000000
-U 00222 0000023456 1.050000000000000000000000000000
-U 00222 0000023456 1.050000000000000000000000000000
-U 00222 0000023456 1.050000000000000000000000000000
-
-3.5.8.3/4 - single SQL - delete
--------------------------------
-drop trigger trg3;
-Create trigger trg4 AFTER UPDATE on tb3 for each row
-delete from db_test.t1_d where d136= new.f136;
-update tb3 set f120='D', f136=444,
-f122='Test 3.5.8.4-Single Delete'
- where f122='Test 3.5.8.4-Single Update';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_d order by d120;
-d120 d136 d144 d163
-a 00111 0000099999 999.990000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-
-3.5.8.3/4 - single SQL - select
--------------------------------
-drop trigger trg4;
-Create trigger trg5 AFTER UPDATE on tb3 for each row
-select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
-where u136= new.f136;
-set @test_var=0;
-update tb3 set f120='S', f136=111,
-f122='Test 3.5.8.4-Single Select'
- where f122='Test 3.5.8.4-Single Delete';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-S Test 3.5.8.4-Single Select 00111 0000023456 1.050000000000000000000000000000
-select @test_var;
-@test_var
-999.990000000000000000000000000000
-drop trigger trg1;
-drop trigger trg5;
-drop database if exists db_test;
-delete from tb3 where f122 like 'Test 3.5.8.4%';
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.8.5 (IF):
-----------------------
-create trigger trg2 before insert on tb3 for each row
-BEGIN
-IF new.f120='1' then
-set @test_var='one', new.f120='2';
-ELSEIF new.f120='2' then
-set @test_var='two', new.f120='3';
-ELSEIF new.f120='3' then
-set @test_var='three', new.f120='4';
-END IF;
-IF (new.f120='4') and (new.f136=10) then
-set @test_var2='2nd if', new.f120='d';
-ELSE
-set @test_var2='2nd else', new.f120='D';
-END IF;
-END//
-set @test_var='Empty', @test_var2=0;
-Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-D Test 3.5.8.5-if 00101 one 2nd else
-Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-D Test 3.5.8.5-if 00101 two 2nd else
-D Test 3.5.8.5-if 00102 two 2nd else
-Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-d Test 3.5.8.5-if 00010 three 2nd if
-D Test 3.5.8.5-if 00101 three 2nd if
-D Test 3.5.8.5-if 00102 three 2nd if
-Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-d Test 3.5.8.5-if 00010 three 2nd else
-D Test 3.5.8.5-if 00101 three 2nd else
-D Test 3.5.8.5-if 00102 three 2nd else
-D Test 3.5.8.5-if 00103 three 2nd else
-create trigger trg3 before update on tb3 for each row
-BEGIN
-ELSEIF new.f120='2' then
-END IF;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ELSEIF new.f120='2' then
-END IF;
-END' at line 3
-drop trigger trg3//
-create trigger trg4 before update on tb3 for each row
-BEGIN
-IF (new.f120='4') and (new.f136=10) then
-set @test_var2='2nd if', new.f120='d';
-ELSE
-set @test_var2='2nd else', new.f120='D';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7
-drop trigger trg4;
-drop trigger trg2;
-delete from tb3 where f121='Test 3.5.8.5-if';
-
-Testcase 3.5.8.5-case:
-----------------------
-create trigger trg3 before insert on tb3 for each row
-BEGIN
-SET new.f120=char(ascii(new.f120)-32);
-CASE
-when new.f136<100 then set new.f136=new.f136+120;
-when new.f136<10 then set new.f144=777;
-when new.f136>100 then set new.f120=new.f136-1;
-END case;
-CASE
-when new.f136=200 then set @test_var=CONCAT(new.f120, '=');
-ELSE set @test_var=concat(new.f120, '*');
-END case;
-CASE new.f144
-when 1 then set @test_var=concat(@test_var, 'one');
-when 2 then set @test_var=concat(@test_var, 'two');
-when 3 then set @test_var=concat(@test_var, 'three');
-when 4 then set @test_var=concat(@test_var, 'four');
-when 5 then set @test_var=concat(@test_var, 'five');
-when 6 then set @test_var=concat(@test_var, 'six');
-when 7 then set @test_var=concat(@test_var, 'seven');
-when 8 then set @test_var=concat(@test_var, 'eight');
-when 9 then set @test_var=concat(@test_var, 'nine');
-when 10 then set @test_var=concat(@test_var, 'ten');
-when 11 then set @test_var=concat(@test_var, 'eleven');
-when 12 then set @test_var=concat(@test_var, 'twelve');
-when 13 then set @test_var=concat(@test_var, 'thirteen');
-when 14 then set @test_var=concat(@test_var, 'fourteen');
-when 15 then set @test_var=concat(@test_var, 'fifteen');
-ELSE set @test_var=CONCAT(new.f120, '*', new.f144);
-END case;
-END//
-set @test_var='Empty';
-Insert into tb3 (f120, f122, f136, f144)
-values ('a', 'Test 3.5.8.5-case', 5, 7);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-A Test 3.5.8.5-case 00125 0000000007 A*seven
-Insert into tb3 (f120, f122, f136, f144)
-values ('b', 'Test 3.5.8.5-case', 71,16);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-A Test 3.5.8.5-case 00125 0000000007 B*0000000016
-B Test 3.5.8.5-case 00191 0000000016 B*0000000016
-Insert into tb3 (f120, f122, f136, f144)
-values ('c', 'Test 3.5.8.5-case', 80,1);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-A Test 3.5.8.5-case 00125 0000000007 C=one
-B Test 3.5.8.5-case 00191 0000000016 C=one
-C Test 3.5.8.5-case 00200 0000000001 C=one
-Insert into tb3 (f120, f122, f136)
-values ('d', 'Test 3.5.8.5-case', 152);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
-A Test 3.5.8.5-case 00125 0000000007 1*0000099999
-B Test 3.5.8.5-case 00191 0000000016 1*0000099999
-C Test 3.5.8.5-case 00200 0000000001 1*0000099999
-Insert into tb3 (f120, f122, f136, f144)
-values ('e', 'Test 3.5.8.5-case', 200, 8);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-1 Test 3.5.8.5-case 00152 0000099999 1=eight
-1 Test 3.5.8.5-case 00200 0000000008 1=eight
-A Test 3.5.8.5-case 00125 0000000007 1=eight
-B Test 3.5.8.5-case 00191 0000000016 1=eight
-C Test 3.5.8.5-case 00200 0000000001 1=eight
-Insert into tb3 (f120, f122, f136, f144)
-values ('f', 'Test 3.5.8.5-case', 100, 8);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-1 Test 3.5.8.5-case 00152 0000099999 1=eight
-1 Test 3.5.8.5-case 00200 0000000008 1=eight
-A Test 3.5.8.5-case 00125 0000000007 1=eight
-B Test 3.5.8.5-case 00191 0000000016 1=eight
-C Test 3.5.8.5-case 00200 0000000001 1=eight
-create trigger trg3a before update on tb3 for each row
-BEGIN
-CASE
-when new.f136<100 then set new.f120='p';
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
-drop trigger trg3a;
-drop trigger trg3;
-delete from tb3 where f121='Test 3.5.8.5-case';
-
-Testcase 3.5.8.5-loop/leave:
-----------------------------
-Create trigger trg4 after insert on tb3 for each row
-BEGIN
-set @counter=0, @flag='Initial';
-Label1: loop
-if new.f136<new.f144 then
-set @counter='Nothing to loop';
-leave Label1;
-else
-set @counter=@counter+1;
-if new.f136=new.f144+@counter then
-set @counter=concat(@counter, ' loops');
-leave Label1;
-end if;
-end if;
-iterate label1;
-set @flag='Final';
-END loop Label1;
-END//
-Insert into tb3 (f122, f136, f144)
-values ('Test 3.5.8.5-loop', 2, 8);
-select @counter, @flag;
-@counter @flag
-Nothing to loop Initial
-Insert into tb3 (f122, f136, f144)
-values ('Test 3.5.8.5-loop', 11, 8);
-select @counter, @flag;
-@counter @flag
-3 loops Initial
-Create trigger trg4_2 after update on tb3 for each row
-BEGIN
-Label1: loop
-set @counter=@counter+1;
-END;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-END' at line 5
-drop trigger trg4_2;
-drop trigger trg4;
-delete from tb3 where f122='Test 3.5.8.5-loop';
-
-Testcase 3.5.8.5-repeat:
-------------------------
-Create trigger trg6 after insert on tb3 for each row
-BEGIN
-rp_label: REPEAT
-SET @counter1 = @counter1 + 1;
-IF (@counter1 MOD 2 = 0) THEN ITERATE rp_label;
-END IF;
-SET @counter2 = @counter2 + 1;
-UNTIL @counter1> new.f136 END REPEAT rp_label;
-END//
-set @counter1= 0, @counter2= 0;
-Insert into tb3 (f122, f136)
-values ('Test 3.5.8.5-repeat', 13);
-select @counter1, @counter2;
-@counter1 @counter2
-15 8
-Create trigger trg6_2 after update on tb3 for each row
-BEGIN
-REPEAT
-SET @counter2 = @counter2 + 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 5
-drop trigger trg6;
-delete from tb3 where f122='Test 3.5.8.5-repeat';
-
-Testcase 3.5.8.5-while:
------------------------
-Create trigger trg7 after insert on tb3 for each row
-wl_label: WHILE @counter1 < new.f136 DO
-SET @counter1 = @counter1 + 1;
-IF (@counter1 MOD 2 = 0) THEN ITERATE wl_label;
-END IF;
-SET @counter2 = @counter2 + 1;
-END WHILE wl_label//
-set @counter1= 0, @counter2= 0;
-Insert into tb3 (f122, f136)
-values ('Test 3.5.8.5-while', 7);
-select @counter1, @counter2;
-@counter1 @counter2
-7 4
-Create trigger trg7_2 after update on tb3 for each row
-BEGIN
-WHILE @counter1 < new.f136
-SET @counter1 = @counter1 + 1;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @counter1 = @counter1 + 1;
-END' at line 4
-delete from tb3 where f122='Test 3.5.8.5-while';
-drop trigger trg7;
-
-Testcase 3.5.8.6: (requirement void)
-------------------------------------
-CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
-CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
-BEGIN
-CALL sp_01 ();
-END//
-Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
-update tb3 set f120='S', f136=111,
-f122='Test 3.5.8.6-tr8_1'
- where f122='Test 3.5.8.6-insert';
-select f120, f122
-from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
-f120 f122
-S Test 3.5.8.6-tr8_1
-DROP TRIGGER trg8_1;
-DROP PROCEDURE sp_01;
-
-Testcase 3.5.8.7
-----------------
-Create trigger trg9_1 before update on tb3 for each row
-BEGIN
-Start transaction;
-Set new.f120='U';
-Commit;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-Create trigger trg9_2 before delete on tb3 for each row
-BEGIN
-Start transaction;
-Set @var2=old.f120;
-Rollback;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-drop user test_general@localhost;
-drop user test_general;
-drop user test_super@localhost;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_09.result.moved b/mysql-test/suite/funcs_1/r/ndb_trig_09.result.moved
deleted file mode 100644
index d9bc16c20d3..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_09.result.moved
+++ /dev/null
@@ -1,275 +0,0 @@
-USE test;
-drop table if exists tb3 ;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
-into table tb3;
-
-Testcase 3.5.9.1/2:
--------------------
-Create trigger trg1 BEFORE UPDATE on tb3 for each row
-set new.f142 = 94087, @counter=@counter+1;
-TotalRows
-10
-Affected
-8
-NotAffected
-2
-NewValuew
-0
-set @counter=0;
-Update tb3 Set f142='1' where f130<100;
-select count(*) as ExpectedChanged, @counter as TrigCounter
-from tb3 where f142=94087;
-ExpectedChanged TrigCounter
-8 8
-select count(*) as ExpectedNotChange from tb3
-where f130<100 and f142<>94087;
-ExpectedNotChange
-0
-select count(*) as NonExpectedChanged from tb3
-where f130>=130 and f142=94087;
-NonExpectedChanged
-0
-drop trigger trg1;
-
-Testcase 3.5.9.3:
------------------
-Create trigger trg2_a before update on tb3 for each row
-set @tr_var_b4_118=old.f118, @tr_var_b4_121=old.f121,
-@tr_var_b4_122=old.f122, @tr_var_b4_136=old.f136,
-@tr_var_b4_163=old.f163;
-Create trigger trg2_b after update on tb3 for each row
-set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
-@tr_var_af_122=old.f122, @tr_var_af_136=old.f136,
-@tr_var_af_163=old.f163;
-Create trigger trg2_c before delete on tb3 for each row
-set @tr_var_b4_118=old.f118, @tr_var_b4_121=old.f121,
-@tr_var_b4_122=old.f122, @tr_var_b4_136=old.f136,
-@tr_var_b4_163=old.f163;
-Create trigger trg2_d after delete on tb3 for each row
-set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
-@tr_var_af_122=old.f122, @tr_var_af_136=old.f136,
-@tr_var_af_163=old.f163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-0 0 0 0 0
-Insert into tb3 (f122, f136, f163)
-values ('Test 3.5.9.3', 7, 123.17);
-Update tb3 Set f136=8 where f122='Test 3.5.9.3';
-select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
-f118 f121 f122 f136 f163
-a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-0 0 0 0 0
-delete from tb3 where f122='Test 3.5.9.3';
-select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
-f118 f121 f122 f136 f163
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-a NULL Test 3.5.9.3 8 123.170000000000000000000000000000
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-a NULL Test 3.5.9.3 8 123.170000000000000000000000000000
-drop trigger trg2_a;
-drop trigger trg2_b;
-drop trigger trg2_c;
-drop trigger trg2_d;
-
-Testcase 3.5.9.4:
------------------
-Create trigger trg3_a before insert on tb3 for each row
-set @tr_var_b4_118=new.f118, @tr_var_b4_121=new.f121,
-@tr_var_b4_122=new.f122, @tr_var_b4_136=new.f136,
-@tr_var_b4_151=new.f151, @tr_var_b4_163=new.f163;
-Create trigger trg3_b after insert on tb3 for each row
-set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
-@tr_var_af_122=new.f122, @tr_var_af_136=new.f136,
-@tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
-Create trigger trg3_c before update on tb3 for each row
-set @tr_var_b4_118=new.f118, @tr_var_b4_121=new.f121,
-@tr_var_b4_122=new.f122, @tr_var_b4_136=new.f136,
-@tr_var_b4_151=new.f151, @tr_var_b4_163=new.f163;
-Create trigger trg3_d after update on tb3 for each row
-set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
-@tr_var_af_122=new.f122, @tr_var_af_136=new.f136,
-@tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-0 0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-0 0 0 0 0 0
-Insert into tb3 (f122, f136, f151, f163)
-values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
-select f118, f121, f122, f136, f151, f163 from tb3
-where f122 like 'Test 3.5.9.4%' order by f163;
-f118 f121 f122 f136 f151 f163
-a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-0 0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-0 0 0 0 0 0
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
-ERROR 23000: Column 'f136' cannot be null
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
-select f118, f121, f122, f136, f151, f163 from tb3
-where f122 like 'Test 3.5.9.4-trig' order by f163;
-f118 f121 f122 f136 f151 f163
-a NULL Test 3.5.9.4-trig 00000 999 NULL
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
-drop trigger trg3_a;
-drop trigger trg3_b;
-drop trigger trg3_c;
-drop trigger trg3_d;
-delete from tb3 where f122='Test 3.5.9.4-trig';
-
-Testcase 3.5.9.5: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.9.6:
------------------
-create trigger trg4a before insert on tb3 for each row
-set @temp1= old.f120;
-ERROR HY000: There is no OLD row in on INSERT trigger
-create trigger trg4b after insert on tb3 for each row
-set old.f120= 'test';
-ERROR HY000: Updating of OLD row is not allowed in trigger
-drop trigger trg4a;
-drop trigger trg4b;
-
-Testcase 3.5.9.7: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.9.8: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.9.9:
------------------
-create trigger trg5a before DELETE on tb3 for each row
-set @temp1=new.f122;
-ERROR HY000: There is no NEW row in on DELETE trigger
-create trigger trg5b after DELETE on tb3 for each row
-set new.f122='test';
-ERROR HY000: There is no NEW row in on DELETE trigger
-drop trigger trg5a;
-drop trigger trg5b;
-
-Testcase 3.5.9.10: (implied in previous tests)
-----------------------------------------------
-
-Testcase 3.5.9.11: covered by 3.5.9.9
--------------------------------------
-
-Testcase 3.5.9.12: covered by 3.5.9.6
--------------------------------------
-
-Testcase 3.5.9.13:
-------------------
-create trigger trg6a before UPDATE on tb3 for each row
-set old.f118='C', new.f118='U';
-ERROR HY000: Updating of OLD row is not allowed in trigger
-create trigger trg6b after INSERT on tb3 for each row
-set old.f136=163, new.f118='U';
-ERROR HY000: Updating of OLD row is not allowed in trigger
-create trigger trg6c after UPDATE on tb3 for each row
-set old.f136=NULL;
-ERROR HY000: Updating of OLD row is not allowed in trigger
-drop trigger trg6a;
-drop trigger trg6b;
-drop trigger trg6c;
-
-Testcase 3.5.9.14: (implied in previous tests)
-----------------------------------------------
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result.moved b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result.moved
deleted file mode 100644
index 611e3460af4..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result.moved
+++ /dev/null
@@ -1,404 +0,0 @@
-USE test;
-drop table if exists tb3 ;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 tinytext,
-f122 text,
-f123 mediumtext,
-f124 longtext unicode,
-f125 tinyblob,
-f126 blob,
-f127 mediumblob,
-f128 longblob,
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = ndb;
-Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
-into table tb3;
-
-Testcase 3.5.10.1/2/3:
-----------------------
-Create view vw11 as select * from tb3
-where f122 like 'Test 3.5.10.1/2/3%';
-Create trigger trg1a before insert on tb3
-for each row set new.f163=111.11;
-Create trigger trg1b after insert on tb3
-for each row set @test_var='After Insert';
-Create trigger trg1c before update on tb3
-for each row set new.f121='Y', new.f122='Test 3.5.10.1/2/3-Update';
-Create trigger trg1d after update on tb3
-for each row set @test_var='After Update';
-Create trigger trg1e before delete on tb3
-for each row set @test_var=5;
-Create trigger trg1f after delete on tb3
-for each row set @test_var= 2* @test_var+7;
-Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
-Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
-Insert into vw11 (f122, f151) values ('Not in View', 3);
-select f121, f122, f151, f163
-from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
-f121 f122 f151 f163
-NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
-NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
-select f121, f122, f151, f163 from vw11;
-f121 f122 f151 f163
-NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
-NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
-select f121, f122, f151, f163
-from tb3 where f122 like 'Not in View';
-f121 f122 f151 f163
-NULL Not in View 3 111.110000000000000000000000000000
-Update vw11 set f163=1;
-select f121, f122, f151, f163 from tb3
-where f122 like 'Test 3.5.10.1/2/3%' order by f151;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-select f121, f122, f151, f163 from vw11;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
-set @test_var=0;
-Select @test_var as 'before delete';
-before delete
-0
-delete from vw11 where f151=1;
-select f121, f122, f151, f163 from tb3
-where f122 like 'Test 3.5.10.1/2/3%' order by f151;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-select f121, f122, f151, f163 from vw11;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-Select @test_var as 'after delete';
-after delete
-17
-drop view vw11;
-drop trigger trg1a;
-drop trigger trg1b;
-drop trigger trg1c;
-drop trigger trg1d;
-drop trigger trg1e;
-drop trigger trg1f;
-delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
-
-Testcase 3.5.10.4:
-------------------
-create table tb_load (f1 int, f2 char(25),f3 int) engine=ndb;
-Create trigger trg4 before insert on tb_load
-for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
-set @counter= 0;
-select @counter as 'Rows Loaded Before';
-Rows Loaded Before
-0
-load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
-select @counter as 'Rows Loaded After';
-Rows Loaded After
-10
-Select * from tb_load order by f1 limit 10;
-f1 f2 f3
--5000 a` 1000
--4999 aaa 999
--4998 abaa 999
--4997 acaaa 999
--4996 adaaaa 999
--4995 aeaaaaa 999
--4994 afaaaaaa 998
--4993 agaaaaaaa 998
--4992 a^aaaaaaaa 998
--4991 a_aaaaaaaaa 998
-drop trigger trg4;
-drop table tb_load;
-
-Testcase 3.5.10.5: (implemented in trig_frkey.test)
----------------------------------------------------
-
-Testcase 3.5.10.6: (implemented in trig_frkey.test)
----------------------------------------------------
-
-Testcase 3.5.10.extra:
-----------------------
-create table t1_sp (var136 tinyint, var151 decimal) engine=ndb;
-create trigger trg before insert on t1_sp
-for each row set @counter=@counter+1;
-create procedure trig_sp()
-begin
-declare done int default 0;
-declare var151 decimal;
-declare var136 tinyint;
-declare cur1 cursor for select f136, f151 from tb3;
-declare continue handler for sqlstate '01000' set done = 1;
-open cur1;
-fetch cur1 into var136, var151;
-wl_loop: WHILE NOT done DO
-insert into t1_sp values (var136, var151);
-fetch cur1 into var136, var151;
-END WHILE wl_loop;
-close cur1;
-end//
-set @counter=0;
-select @counter;
-@counter
-0
-call trig_sp();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-select @counter;
-@counter
-11
-select count(*) from tb3;
-count(*)
-11
-select count(*) from t1_sp;
-count(*)
-11
-drop procedure trig_sp;
-drop trigger trg;
-drop table t1_sp;
-
-Testcase 3.5.11.1 (implemented in trig_perf.test)
--------------------------------------------------
-
-Testcase y.y.y.2: Check for triggers starting triggers
-------------------------------------------------------
-use test;
-drop table if exists t1;
-drop table if exists t2_1;
-drop table if exists t2_2;
-drop table if exists t2_3;
-drop table if exists t2_4;
-drop table if exists t3;
-create table t1 (f1 integer) engine=ndb;
-create table t2_1 (f1 integer) engine=ndb;
-create table t2_2 (f1 integer) engine=ndb;
-create table t2_3 (f1 integer) engine=ndb;
-create table t2_4 (f1 integer) engine=ndb;
-create table t3 (f1 integer) engine=ndb;
-insert into t1 values (1);
-create trigger tr1 after insert on t1 for each row
-BEGIN
-insert into t2_1 (f1) values (new.f1+1);
-insert into t2_2 (f1) values (new.f1+1);
-insert into t2_3 (f1) values (new.f1+1);
-insert into t2_4 (f1) values (new.f1+1);
-END//
-create trigger tr2_1 after insert on t2_1 for each row
-insert into t3 (f1) values (new.f1+10);
-create trigger tr2_2 after insert on t2_2 for each row
-insert into t3 (f1) values (new.f1+100);
-create trigger tr2_3 after insert on t2_3 for each row
-insert into t3 (f1) values (new.f1+1000);
-create trigger tr2_4 after insert on t2_4 for each row
-insert into t3 (f1) values (new.f1+10000);
-insert into t1 values (1);
-select * from t3 order by f1;
-f1
-12
-102
-1002
-10002
-drop trigger tr1;
-drop trigger tr2_1;
-drop trigger tr2_2;
-drop trigger tr2_3;
-drop trigger tr2_4;
-drop table t1, t2_1, t2_2, t2_3, t2_4, t3;
-
-Testcase y.y.y.3: Circular trigger reference
---------------------------------------------
-use test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-drop table if exists t4;
-create table t1 (f1 integer) engine = ndb;
-create table t2 (f2 integer) engine = ndb;
-create table t3 (f3 integer) engine = ndb;
-create table t4 (f4 integer) engine = ndb;
-insert into t1 values (0);
-create trigger tr1 after insert on t1
-for each row insert into t2 (f2) values (new.f1+1);
-create trigger tr2 after insert on t2
-for each row insert into t3 (f3) values (new.f2+1);
-create trigger tr3 after insert on t3
-for each row insert into t4 (f4) values (new.f3+1);
-create trigger tr4 after insert on t4
-for each row insert into t1 (f1) values (new.f4+1);
-insert into t1 values (1);
-ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
-select * from t1 order by f1;
-f1
-0
-select * from t2 order by f2;
-f2
-select * from t3 order by f3;
-f3
-select * from t4 order by f4;
-f4
-drop trigger tr1;
-drop trigger tr2;
-drop trigger tr3;
-drop trigger tr4;
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
-
-Testcase y.y.y.4: Recursive trigger/SP references
--------------------------------------------------
-set @sql_mode='traditional';
-create table t1_sp (
-count integer,
-var136 tinyint,
-var151 decimal) engine=ndb;
-create procedure trig_sp()
-begin
-declare done int default 0;
-declare var151 decimal;
-declare var136 tinyint;
-declare cur1 cursor for select f136, f151 from tb3;
-declare continue handler for sqlstate '01000' set done = 1;
-set @counter= @counter+1;
-open cur1;
-fetch cur1 into var136, var151;
-wl_loop: WHILE NOT done DO
-insert into t1_sp values (@counter, var136, var151);
-fetch cur1 into var136, var151;
-END WHILE wl_loop;
-close cur1;
-end//
-create trigger trg before insert on t1_sp
-for each row call trig_sp();
-set @counter=0;
-select @counter;
-@counter
-0
-call trig_sp();
-ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine trig_sp
-select @counter;
-@counter
-1
-select count(*) from tb3;
-count(*)
-11
-select count(*) from t1_sp;
-count(*)
-0
-set @@max_sp_recursion_depth= 10;
-set @counter=0;
-select @counter;
-@counter
-0
-call trig_sp();
-ERROR HY000: Can't update table 't1_sp' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
-select @counter;
-@counter
-2
-select count(*) from tb3;
-count(*)
-11
-select count(*) from t1_sp;
-count(*)
-0
-drop procedure trig_sp;
-drop trigger trg;
-drop table t1_sp;
-
-Testcase y.y.y.5: Roleback of nested trigger references
--------------------------------------------------------
-set @@sql_mode='traditional';
-use test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-drop table if exists t4;
-create table t1 (f1 integer) engine = ndb;
-create table t2 (f2 integer) engine = ndb;
-create table t3 (f3 integer) engine = ndb;
-create table t4 (f4 tinyint) engine = ndb;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f1` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-insert into t1 values (1);
-create trigger tr1 after insert on t1
-for each row insert into t2 (f2) values (new.f1+1);
-create trigger tr2 after insert on t2
-for each row insert into t3 (f3) values (new.f2+1);
-create trigger tr3 after insert on t3
-for each row insert into t4 (f4) values (new.f3+1000);
-set autocommit=0;
-start transaction;
-insert into t1 values (1);
-ERROR 22003: Out of range value for column 'f4' at row 1
-commit;
-select * from t1 order by f1;
-f1
-1
-1
-select * from t2 order by f2;
-f2
-2
-select * from t3 order by f3;
-f3
-3
-drop trigger tr1;
-drop trigger tr2;
-drop trigger tr3;
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 04c1a45e67e..38fa933e13f 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -83,20 +83,22 @@ CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934('aaaa
ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 tinytext ) language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = f1;
+CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 TINYTEXT )
+LANGUAGE SQL DETERMINISTIC SQL SECURITY DEFINER COMMENT 'this is simple'
+BEGIN
+SET @v1 = f1;
SELECT @v1, @v1;
END//
ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde' is too long
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 binary ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-set @v1 = f1;
+CREATE PROCEDURE sp1( f1 BINARY )
+LANGUAGE SQL DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+SET @v1 = f1;
SELECT @v1;
END//
CALL sp1( 34 );
@@ -104,1081 +106,2519 @@ CALL sp1( 34 );
3
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 blob ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
+CREATE PROCEDURE sp1( f1 BLOB )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
set @v1 = f1;
SELECT @v1;
END//
CALL sp1( 34 );
@v1
34
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 int ) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE PROCEDURE sp1( f1 INT )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set @v1 = f1;
+SET @v1 = f1;
SELECT @v1;
END//
CALL sp1( 34 );
@v1
34
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 decimal(256, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE PROCEDURE sp1( f1 DECIMAL(256, 30) )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set @v1 = f1;
+SET @v1 = f1;
SELECT @v1;
END//
ERROR 42000: Too big precision 256 specified for column ''. Maximum is 65.
DROP PROCEDURE IF EXISTS sp1//
Warnings:
Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(66, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE PROCEDURE sp1( f1 DECIMAL(66, 30) )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set @v1 = f1;
+SET @v1 = f1;
SELECT @v1;
END//
ERROR 42000: Too big precision 66 specified for column ''. Maximum is 65.
DROP PROCEDURE IF EXISTS sp1//
Warnings:
Note 1305 PROCEDURE sp1 does not exist
-CREATE PROCEDURE sp1( f1 decimal(60, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
+DROP TABLE IF EXISTS t1_aux;
+DROP PROCEDURE IF EXISTS sproc_1;
+DROP FUNCTION IF EXISTS func_1;
+CREATE TABLE t1_aux ( f1 DECIMAL(65, 30) );
+INSERT INTO t1_aux SET f1 = NULL;
+CREATE PROCEDURE sproc_1(f1 DECIMAL(65, 30), OUT f2 DECIMAL(65, 30))
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set @v1 = f1;
-SELECT @v1;
+SET f2 = NULL;
+SET f2 = f1;
+SET @v2_proc = f1;
END//
-CALL sp1( 17976931340000 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.797693134e+13 );
-@v1
-17976931340000.000000000000000000000000000000
-CALL sp1( 1.7976931348623157493578e+308 );
+CREATE FUNCTION func_1(f1 DECIMAL(65, 30)) RETURNS DECIMAL(65,30)
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+RETURN f1;
+END//
+SHOW PROCEDURE STATUS;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+db_storedproc sproc_1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+db_storedproc func_1 FUNCTION root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 1.7976931348623157493578e+308;
ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing
-CALL sp1( 0.1234567890987654321e+100 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(1.7976931348623157493578e+308, @v1_proc);
+ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing
+SET @v1_func = func_1(1.7976931348623157493578e+308);
+ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+100;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-100 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+100, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+99 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+100);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-99 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+99;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+98 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+99, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-98 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+99);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+97 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+98;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-97 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+98, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+96 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+98);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-96 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+97;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+95 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+97, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-95 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+97);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+94 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+96;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-94 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+96, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+93 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+96);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-93 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+95;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+92 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+95, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-92 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+95);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+91 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+94;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-91 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+94, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+90 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+94);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-90 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+93;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+89 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+93, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-89 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+93);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+88 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+92;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-88 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+92, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+87 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+92);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-87 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+91;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+86 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+91, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-86 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+91);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+85 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+90;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-85 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+90, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+84 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+90);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-84 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+89;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+83 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+89, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-83 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+89);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+82 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+88;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-82 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+88, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+81 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+88);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-81 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+87;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+80 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+87, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-80 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+87);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+79 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+86;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-79 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+86, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+78 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+86);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-78 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+85;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+77 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+85, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-77 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+85);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+76 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+84;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-76 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+84, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+75 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+84);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-75 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+83;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+74 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+83, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-74 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+83);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+73 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+82;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-73 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+82, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+72 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+82);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-72 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+81;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+71 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+81, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-71 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+81);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+70 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+80;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-70 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+80, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+69 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+80);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-69 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+79;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+68 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+79, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-68 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+79);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+67 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+78;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-67 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+78, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+66 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+78);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-66 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+77;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+65 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+77, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-65 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+77);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+64 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+76;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-64 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+76, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+63 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+76);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-63 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+75;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+62 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+75, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-62 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+75);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+61 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+74;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-61 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+74, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+60 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+74);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-60 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+73;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+59 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+73, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-59 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+73);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+58 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+72;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-58 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+72, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+57 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+72);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-57 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+71;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+56 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+71, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-56 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+71);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+55 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+70;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-55 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+70, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+54 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+70);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-54 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+69;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+53 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+69, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-53 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+69);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+52 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+68;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-52 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+68, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+51 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+68);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-51 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+67;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+50 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+67, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-50 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+67);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+49 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+66;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-49 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+66, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+48 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+66);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-48 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+65;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+47 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+65, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-47 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+65);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+46 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+64;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-46 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+64, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+45 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+64);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-45 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+63;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+44 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+63, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-44 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+63);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+43 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+62;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-43 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+62, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+42 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+62);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-42 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+61;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+41 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+61, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-41 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+61);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+40 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+60;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-40 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+60, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+39 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+60);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-39 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+59;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+38 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+59, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-38 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+59);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+37 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+58;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-37 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+58, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+36 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+58);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-36 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+57;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+35 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+57, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-35 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+57);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+34 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+56;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-34 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+56, @v1_proc);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+33 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+56);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-33 );
-@v1
-0.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+55;
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+32 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+55, @v1_proc);
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-32 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+55);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+31 );
-@v1
-999999999999999999999999999999.999999999999999999999999999999
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+54;
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-31 );
-@v1
-0.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+54, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+54);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+53;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+53, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+53);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+52;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+52, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+52);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+51;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+51, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+51);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+50;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+50, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+50);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+49;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+49, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+49);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+48;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+48, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+48);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+47;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+47, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+47);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+46;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+46, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+46);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+45;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+45, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+45);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+44;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+44, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+44);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+43;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+43, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+43);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+42;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+42, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+42);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+41;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+41, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+41);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+40;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+40, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+40);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+39;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+39, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+39);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+38;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+38, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+38);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+37;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+37, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+37);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+36;
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+36, @v1_proc);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+36);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+35;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+30 );
-@v1
-123456789098765400000000000000.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+35, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-30 );
-@v1
-0.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+35);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+29 );
-@v1
-12345678909876540000000000000.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+34;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-29 );
-@v1
-0.000000000000000000000000000001
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+34, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+28 );
-@v1
-1234567890987654000000000000.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+34);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-28 );
-@v1
-0.000000000000000000000000000012
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+33;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+27 );
-@v1
-123456789098765400000000000.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+33, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-27 );
-@v1
-0.000000000000000000000000000123
+SET @v1_func = func_1(0.1234567890987654321e+33);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+26 );
-@v1
-12345678909876540000000000.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+32;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-26 );
-@v1
-0.000000000000000000000000001235
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+32, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+25 );
-@v1
-1234567890987654000000000.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+32);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-25 );
-@v1
-0.000000000000000000000000012346
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+31;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+24 );
-@v1
-123456789098765400000000.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+31, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-24 );
-@v1
-0.000000000000000000000000123457
+SET @v1_func = func_1(0.1234567890987654321e+31);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+23 );
-@v1
-12345678909876540000000.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+30;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-23 );
-@v1
-0.000000000000000000000001234568
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+30, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+22 );
-@v1
-1234567890987654000000.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+30);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-22 );
-@v1
-0.000000000000000000000012345679
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+29;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+21 );
-@v1
-123456789098765400000.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+29, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-21 );
-@v1
-0.000000000000000000000123456789
+SET @v1_func = func_1(0.1234567890987654321e+29);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+20 );
-@v1
-12345678909876540000.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+28;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-20 );
-@v1
-0.000000000000000000001234567891
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+28, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+19 );
-@v1
-1234567890987654000.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+28);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-19 );
-@v1
-0.000000000000000000012345678910
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+27;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+18 );
-@v1
-123456789098765400.000000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+27, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-18 );
-@v1
-0.000000000000000000123456789099
+SET @v1_func = func_1(0.1234567890987654321e+27);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+17 );
-@v1
-12345678909876540.000000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+26;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-17 );
-@v1
-0.000000000000000001234567890988
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+26, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+16 );
-@v1
-1234567890987654.000000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+26);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-16 );
-@v1
-0.000000000000000012345678909877
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+25;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+15 );
-@v1
-123456789098765.400000000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+25, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-15 );
-@v1
-0.000000000000000123456789098765
+SET @v1_func = func_1(0.1234567890987654321e+25);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+14 );
-@v1
-12345678909876.540000000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+24;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-14 );
-@v1
-0.000000000000001234567890987654
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+24, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+13 );
-@v1
-1234567890987.654000000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+24);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-13 );
-@v1
-0.000000000000012345678909876540
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+23;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+12 );
-@v1
-123456789098.765400000000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+23, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-12 );
-@v1
-0.000000000000123456789098765400
+SET @v1_func = func_1(0.1234567890987654321e+23);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+11 );
-@v1
-12345678909.876540000000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+22;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-11 );
-@v1
-0.000000000001234567890987654000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+22, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+10 );
-@v1
-1234567890.987654000000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+22);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-10 );
-@v1
-0.000000000012345678909876540000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+21;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+9 );
-@v1
-123456789.098765400000000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+21, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-9 );
-@v1
-0.000000000123456789098765400000
+SET @v1_func = func_1(0.1234567890987654321e+21);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+8 );
-@v1
-12345678.909876540000000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+20;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-8 );
-@v1
-0.000000001234567890987654000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+20, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+7 );
-@v1
-1234567.890987654000000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+20);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-7 );
-@v1
-0.000000012345678909876540000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+19;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+6 );
-@v1
-123456.789098765400000000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+19, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-6 );
-@v1
-0.000000123456789098765400000000
+SET @v1_func = func_1(0.1234567890987654321e+19);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+5 );
-@v1
-12345.678909876540000000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+18;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-5 );
-@v1
-0.000001234567890987654000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+18, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+4 );
-@v1
-1234.567890987654000000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+18);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-4 );
-@v1
-0.000012345678909876550000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+17;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+3 );
-@v1
-123.456789098765400000000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+17, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-3 );
-@v1
-0.000123456789098765400000000000
+SET @v1_func = func_1(0.1234567890987654321e+17);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+2 );
-@v1
-12.345678909876540000000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+16;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-2 );
-@v1
-0.001234567890987654000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+16, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+1 );
-@v1
-1.234567890987654000000000000000
+SET @v1_func = func_1(0.1234567890987654321e+16);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-1 );
-@v1
-0.012345678909876540000000000000
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+15;
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e+0 );
-@v1
-0.123456789098765400000000000000
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+15, @v1_proc);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-CALL sp1( 0.1234567890987654321e-0 );
-@v1
-0.123456789098765400000000000000
+SET @v1_func = func_1(0.1234567890987654321e+15);
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+14;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+14, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+14);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+13;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+13, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+13);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+12;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+12, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+12);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+11;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+11, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+11);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+10;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+10, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+10);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+9;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+9, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+9);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+8;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+8, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+8);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+7;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+7, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+7);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+6;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+6, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+6);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+5;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+5, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+5);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+4;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+4, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+4);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+3;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+3, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+3);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+2;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+2, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+2);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+1;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+1, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+1);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e+0;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e+0, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e+0);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-100;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-100, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-100);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-99;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-99, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-99);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-98;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-98, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-98);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-97;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-97, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-97);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-96;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-96, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-96);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-95;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-95, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-95);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-94;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-94, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-94);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-93;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-93, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-93);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-92;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-92, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-92);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-91;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-91, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-91);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-90;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-90, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-90);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-89;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-89, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-89);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-88;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-88, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-88);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-87;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-87, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-87);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-86;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-86, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-86);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-85;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-85, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-85);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-84;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-84, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-84);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-83;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-83, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-83);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-82;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-82, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-82);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-81;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-81, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-81);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-80;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-80, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-80);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-79;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-79, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-79);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-78;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-78, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-78);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-77;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-77, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-77);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-76;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-76, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-76);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-75;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-75, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-75);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-74;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-74, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-74);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-73;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-73, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-73);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-72;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-72, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-72);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-71;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-71, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-71);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-70;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-70, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-70);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-69;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-69, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-69);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-68;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-68, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-68);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-67;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-67, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-67);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-66;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-66, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-66);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-65;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-65, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-65);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-64;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-64, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-64);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-63;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-63, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-63);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-62;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-62, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-62);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-61;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-61, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-61);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-60;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-60, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-60);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-59;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-59, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-59);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-58;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-58, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-58);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-57;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-57, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-57);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-56;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-56, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-56);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-55;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-55, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-55);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-54;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-54, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-54);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-53;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-53, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-53);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-52;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-52, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-52);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-51;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-51, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-51);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-50;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-50, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-50);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-49;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-49, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-49);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-48;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-48, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-48);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-47;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-47, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-47);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-46;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-46, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-46);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-45;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-45, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-45);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-44;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-44, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-44);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-43;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-43, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-43);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-42;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-42, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-42);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-41;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-41, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-41);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-40;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-40, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-40);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-39;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-39, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-39);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-38;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-38, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-38);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-37;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-37, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-37);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-36;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-36, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-36);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-35;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-35, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-35);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-34;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-34, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-34);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-33;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-33, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-33);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-32;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-32, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-32);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-31;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-31, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-31);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-30;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-30, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-30);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-29;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-29, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-29);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-28;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-28, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-28);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-27;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-27, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-27);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-26;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-26, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-26);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-25;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-25, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-25);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-24;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-24, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-24);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-23;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-23, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-23);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-22;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-22, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-22);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-21;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-21, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-21);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-20;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-20, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-20);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-19;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-19, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-19);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-18;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-18, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-18);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-17;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-17, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-17);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-16;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-16, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-16);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-15;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-15, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-15);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-14;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-14, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-14);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-13;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-13, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-13);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-12;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-12, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-12);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-11;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-11, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-11);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-10;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-10, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-10);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-9;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-9, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-9);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-8;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-8, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-8);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-7;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-7, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-7);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-6;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-6, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-6);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-5;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-5, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-5);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-4;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-4, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-4);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-3;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-3, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-3);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-2;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-2, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-2);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-1;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-1, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-1);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+UPDATE t1_aux SET f1 = NULL;
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+UPDATE t1_aux SET f1 = 0.1234567890987654321e-0;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 INTO @v1_tab FROM t1_aux;
+CALL sproc_1(0.1234567890987654321e-0, @v1_proc);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SET @v1_func = func_1(0.1234567890987654321e-0);
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+DROP PROCEDURE sproc_1;
+DROP FUNCTION func_1;
+DROP TABLE t1_aux;
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
+CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
SELECT f1;
END//
Warnings:
@@ -1188,12 +2628,13 @@ f1
value1
Warnings:
Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 set("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
+CREATE PROCEDURE sp1( f1 SET("value1", "value1") )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
SELECT f1;
END//
Warnings:
@@ -1204,12 +2645,13 @@ value1
Warnings:
Note 1291 Column '' has duplicated value 'value1' in SET
Warning 1265 Data truncated for column 'f1' at row 1
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
+CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
SELECT f1;
END//
Warnings:
@@ -1219,57 +2661,57 @@ f1
value1
Warnings:
Note 1291 Column '' has duplicated value 'value1' in ENUM
-SHOW PROCEDURE status;
+SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) language sql SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) LANGUAGE SQL SELECT f1;
CALL sp1( 'abc' );
f1
abc
-SHOW PROCEDURE status like 'sp1';
+SHOW PROCEDURE STATUS LIKE 'sp1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 text ) deterministic SELECT f1;
CALL sp1( 'abc' );
f1
abc
-SHOW PROCEDURE status like 'sp1';
+SHOW PROCEDURE STATUS LIKE 'sp1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) not deterministic SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) NOT DETERMINISTIC SELECT f1;
CALL sp1( 'abc' );
f1
abc
-SHOW PROCEDURE status like 'sp1';
+SHOW PROCEDURE STATUS LIKE 'sp1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security definer SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) SQL SECURITY DEFINER SELECT f1;
CALL sp1( 'abc' );
f1
abc
-SHOW PROCEDURE status like 'sp1';
+SHOW PROCEDURE STATUS LIKE 'sp1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) sql security invoker SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) SQL SECURITY INVOKER SELECT f1;
CALL sp1( 'abc' );
f1
abc
-SHOW PROCEDURE status like 'sp1';
+SHOW PROCEDURE STATUS LIKE 'sp1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( f1 text ) comment 'this is simple' SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) COMMENT 'this is simple' SELECT f1;
CALL sp1( 'abc' );
f1
abc
-SHOW PROCEDURE status like 'sp1';
+SHOW PROCEDURE STATUS LIKE 'sp1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp1 PROCEDURE root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp1 PROCEDURE root@localhost <modified> <created> DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
ERROR 42000: Identifier name 'sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934' is too long
DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde;
@@ -1282,60 +2724,65 @@ Ensure that all clauses that should be supported are supported
CREATE FUNCTION
--------------------------------------------------------------------------------
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
-return concat('hello, ', s, '!');
+CREATE FUNCTION fn1 (s CHAR(20)) RETURNS CHAR(50)
+RETURN CONCAT('hello, ', s, '!');
SELECT fn1('world');
fn1('world')
hello, world!
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 mediumtext ) returns mediumtext language sql deterministic sql security definer comment 'this is simple'
- BEGIN
-set @v1 = 'hello';
-set f1 = concat( @v1, f1 );
-return f1;
+CREATE FUNCTION fn1( f1 MEDIUMTEXT ) RETURNS MEDIUMTEXT
+LANGUAGE SQL DETERMINISTIC SQL SECURITY DEFINER COMMENT 'this is simple'
+BEGIN
+SET @v1 = 'hello';
+SET f1 = CONCAT( @v1, f1 );
+RETURN f1;
END//
SELECT fn1( ' world');
fn1( ' world')
hello world
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql not deterministic sql security invoker comment 'this is simple'
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 decimal(63, 31) ) returns decimal(63, 31) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE FUNCTION fn1( f1 DECIMAL(63, 31) ) RETURNS DECIMAL(63, 31)
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set f1 = 1000000 + f1;
-return f1;
+SET f1 = 1000000 + f1;
+RETURN f1;
END//
ERROR 42000: Too big scale 31 specified for column ''. Maximum is 30.
SELECT fn1( 1.3326e+8 );
ERROR 42000: FUNCTION db_storedproc.fn1 does not exist
-CREATE FUNCTION fn1( f1 decimal(63, 30) ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE FUNCTION fn1( f1 DECIMAL(63, 30) ) RETURNS DECIMAL(63, 30)
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
-set f1 = 1000000 + f1;
-return f1;
+SET f1 = 1000000 + f1;
+RETURN f1;
END//
SELECT fn1( 1.3326e+8 );
fn1( 1.3326e+8 )
134260000.000000000000000000000000000000
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 enum("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
+CREATE FUNCTION fn1( f1 ENUM("value1", "value1") ) RETURNS DECIMAL(63, 30)
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+RETURN f1;
END//
Warnings:
Note 1291 Column '' has duplicated value 'value1' in ENUM
@@ -1344,11 +2791,12 @@ fn1( "value1" )
1.000000000000000000000000000000
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 set("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
-return f1;
+CREATE FUNCTION fn1( f1 SET("value1", "value1") ) RETURNS DECIMAL(63, 30)
+LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+RETURN f1;
END//
Warnings:
Note 1291 Column '' has duplicated value 'value1' in SET
@@ -1357,82 +2805,79 @@ fn1( "value1, value1" )
1.000000000000000000000000000000
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT LANGUAGE SQL
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint deterministic
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT DETERMINISTIC
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint not deterministic
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT NOT DETERMINISTIC
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security definer
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT SQL SECURITY DEFINER
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-sql security invoker
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT SQL SECURITY INVOKER
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
-comment 'this is simple'
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT COMMENT 'this is simple'
BEGIN
-set f1 = 1 + f1;
-return f1;
+SET f1 = 1 + f1;
+RETURN f1;
END//
SELECT fn1( 126 );
fn1( 126 )
127
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION fn1;
Testcase 4.1.3:
@@ -1446,7 +2891,7 @@ SELECT * from t1 where f2 = f1;
show CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
sp1 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(f1 char(20) )
-SELECT * from t1 where f2 = f1 latin1 modified created
+SELECT * from t1 where f2 = f1 latin1 <modified> <created>
DROP PROCEDURE sp1;
Testcase 4.1.4:
@@ -1459,7 +2904,7 @@ return concat('hello, ', s, '!');
show CREATE FUNCTION fn1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
fn1 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(s char(20)) RETURNS char(50) CHARSET latin1
-return concat('hello, ', s, '!') latin1 modified created
+return concat('hello, ', s, '!') latin1 <modified> <created>
DROP FUNCTION fn1;
Testcase 4.1.5:
@@ -1470,7 +2915,7 @@ CREATE PROCEDURE sp5()
SELECT * from t1;
SHOW PROCEDURE status like 'sp5';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp5 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp5 PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE sp5;
Testcase 4.1.6:
@@ -1484,7 +2929,7 @@ return @b;
END//
SHOW FUNCTION STATUS LIKE 'fn5';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn5 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn5 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION fn5;
Testcase 4.1.7:
@@ -1620,7 +3065,7 @@ ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't1'
commit work;
root@localhost db_storedproc
-alter procedure sp11 sql security definer;
+alter procedure sp11 sql security DEFINER;
SELECT security_type from mysql.proc where specific_name='sp11';
security_type
DEFINER
@@ -1648,7 +3093,7 @@ INVOKER
SELECT fn12();
fn12()
100
-alter function fn12 sql security definer;
+alter function fn12 sql security DEFINER;
SELECT security_type from mysql.proc where specific_name='fn12';
security_type
DEFINER
@@ -3291,14 +4736,14 @@ SELECT db_storedproc.sp1();
db_storedproc.sp1()
2
USE db_storedproc;
-alter procedure sp1 sql security definer;
+alter procedure sp1 sql security DEFINER;
CALL db_storedproc.sp1();
@x
1
SELECT db_storedproc.sp1();
db_storedproc.sp1()
2
-alter function sp1 sql security definer;
+alter function sp1 sql security DEFINER;
SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
name type security_type
sp1 FUNCTION DEFINER
@@ -3323,8 +4768,8 @@ database.
DROP DATABASE IF EXISTS db_storedproc_3122;
CREATE DATABASE db_storedproc_3122;
USE db_storedproc;
-set @x=null;
-set @y=null;
+SET @x = NULL;
+SET @y = NULL;
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE sp1 does not exist
@@ -3339,10 +4784,10 @@ Warnings:
Note 1305 FUNCTION sp1 does not exist
CREATE PROCEDURE sp1()
BEGIN
-set @x= 1;
+SET @x = 1;
SELECT @x;
END//
-CREATE FUNCTION db_storedproc_3122.sp1() returns double return 2.2;
+CREATE FUNCTION db_storedproc_3122.sp1() RETURNS DOUBLE RETURN 2.2;
CALL sp1();
@x
1
@@ -3352,19 +4797,19 @@ db_storedproc_3122.sp1()
USE db_storedproc_3122;
CREATE PROCEDURE sp1 ()
BEGIN
-set @x= 3;
+SET @x = 3;
SELECT @x;
END//
-CREATE FUNCTION db_storedproc.sp1() returns double return 4.4;
+CREATE FUNCTION db_storedproc.sp1() RETURNS DOUBLE RETURN 4.4;
CALL sp1();
@x
3
SELECT db_storedproc.sp1();
db_storedproc.sp1()
4.4
-alter procedure db_storedproc_3122.sp1 sql security invoker;
-alter function sp1 sql security invoker;
-SELECT db, name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
+ALTER PROCEDURE db_storedproc_3122.sp1 SQL SECURITY INVOKER;
+ALTER FUNCTION sp1 SQL SECURITY INVOKER;
+SELECT db, name, type, security_type FROM mysql.proc WHERE db LIKE 'db_storedproc%' AND specific_name='sp1';
db name type security_type
db_storedproc sp1 FUNCTION DEFINER
db_storedproc sp1 PROCEDURE DEFINER
@@ -3407,18 +4852,18 @@ CREATE PROCEDURE sp1 () set @x= 3;
CREATE FUNCTION sp1 () returns int return 4;
alter procedure sp1 sql security invoker comment 'this is a procedure';
alter function sp1 sql security invoker comment 'this is a function';
-alter procedure sp1 sql security definer;
-alter function sp1 sql security definer;
+alter procedure sp1 sql security DEFINER;
+alter function sp1 sql security DEFINER;
show CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
sp1 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
COMMENT 'this is a procedure'
-set @x= 3 latin1 modified created
+set @x= 3 latin1 <modified> <created>
show CREATE FUNCTION sp1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
sp1 CREATE DEFINER=`root`@`localhost` FUNCTION `sp1`() RETURNS int(11)
COMMENT 'this is a function'
-return 4 latin1 modified created
+return 4 latin1 <modified> <created>
USE db_storedproc;
DROP DATABASE db_storedproc_3122;
DROP FUNCTION db_storedproc.sp1;
@@ -13559,21 +15004,22 @@ DROP PROCEDURE sp1;
Testcase 4.2.28:
--------------------------------------------------------------------------------
-set @x=0;
-set @y=0;
+SET @x = 0;
+SET @y = 0;
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE sp1 does not exist
+SET @start_global_value = @@GLOBAL.sort_buffer_size;
CREATE PROCEDURE sp1()
BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set session sort_buffer_size = 10 * 1024 * 1024;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @x2 = 1;
+SET SESSION SORT_BUFFER_SIZE = 10 * 1024 * 1024;
SELECT @@sort_buffer_size;
-set @x = 4;
-set @y = 3;
-set global sort_buffer_size = 2 * 1024 * 1024;
+SET @x = 4;
+SET @y = 3;
+SET GLOBAL SORT_BUFFER_SIZE = 2 * 1024 * 1024;
SELECT @@sort_buffer_size;
-set @@sort_buffer_size = 10 * 1024 * 1024;
+SET @@sort_buffer_size = 10 * 1024 * 1024;
SELECT @@sort_buffer_size;
END//
CALL sp1();
@@ -13586,6 +15032,7 @@ CALL sp1();
SELECT @x, @y;
@x @y
4 3
+SET @@GLOBAL.sort_buffer_size = @start_global_value;
Testcase 4.2.29:
--------------------------------------------------------------------------------
@@ -16019,10 +17466,10 @@ DROP DATABASE IF EXISTS d2;
CREATE DATABASE d1;
CREATE DATABASE d2;
USE d1;
-CREATE PROCEDURE sp8 ( n char(20) ) sql security definer comment 'initial'
+CREATE PROCEDURE sp8 ( n char(20) ) sql security DEFINER comment 'initial'
SELECT * from t1 where t1.f1 = n;
USE d2;
-alter procedure d1.sp8 sql security definer comment 'updated';
+alter procedure d1.sp8 sql security DEFINER comment 'updated';
SELECT * from mysql.proc where specific_name='sp8' and db='d1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
@@ -16039,7 +17486,7 @@ set a = 0.9 * n;
return a;
END//
USE d2;
-alter function d1.fn2 sql security definer comment 'updated';
+alter function d1.fn2 sql security DEFINER comment 'updated';
SELECT * from mysql.proc where specific_name='fn2' and db='d1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
d1 fn2 FUNCTION fn2 SQL CONTAINS_SQL NO DEFINER n int int(11) BEGIN
@@ -22094,13 +23541,13 @@ set @y=@x;
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW PROCEDURE status like 'sp6a';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6a PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp6a PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW PROCEDURE status like 'sp6b';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6b PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp6b PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW PROCEDURE status like 'sp6c';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6c PROCEDURE root@localhost modified created DEFINER this is a comment latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp6c PROCEDURE root@localhost <modified> <created> DEFINER this is a comment latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE sp6a;
DROP PROCEDURE sp6b;
DROP PROCEDURE sp6c;
@@ -22115,7 +23562,7 @@ set @y=@x;
END//
SHOW PROCEDURE status like 'sp6';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp6 PROCEDURE root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE sp6;
Testcase 4.8.3:
@@ -22141,7 +23588,7 @@ return 0;
END//
show function status like 'sp6';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp6 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION sp6;
Testcase 4.8.5:
@@ -22190,7 +23637,7 @@ return i1;
END//
SHOW FUNCTION STATUS LIKE 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION fn1;
Testcase 4.8.11:
@@ -22259,7 +23706,7 @@ alter procedure sp6 sql security invoker;
alter procedure sp6 comment 'this is a new comment';
SHOW PROCEDURE status like 'sp6';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc sp6 PROCEDURE root@localhost modified created INVOKER this is a new comment latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc sp6 PROCEDURE root@localhost <modified> <created> INVOKER this is a new comment latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE sp6;
Testcase 4.8.18:
@@ -22290,7 +23737,7 @@ alter function fn1 sql security invoker;
alter function fn1 comment 'this is a function 3242#@%$#@';
show function status like 'fn1';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
-db_storedproc fn1 FUNCTION root@localhost modified created INVOKER this is a function 3242#@%$#@ latin1 latin1_swedish_ci latin1_swedish_ci
+db_storedproc fn1 FUNCTION root@localhost <modified> <created> INVOKER this is a function 3242#@%$#@ latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION fn1;
Testcase 4.8.20:
@@ -23510,19 +24957,19 @@ DROP PROCEDURE IF EXISTS h1;
Testcase 4.11.40:
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
-create table res_t1(w char unique, x char);
-insert into res_t1 values ('a', 'b');
+DROP TABLE IF EXISTS res_t1;
+CREATE TABLE res_t1(w CHAR UNIQUE, x CHAR);
+INSERT INTO res_t1 VALUES ('a', 'b');
CREATE PROCEDURE h1 ()
BEGIN
-declare x1, x2, x3, x4, x5 int default 0;
-declare condname1 condition for sqlstate '42000';
-declare condname2 condition for sqlstate '42000';
-declare continue handler for condname1 set x1 = 1;
-declare continue handler for condname1 set x2 = 1;
-declare exit handler for condname1 set x3 = 1;
-declare continue handler for condname2 set x4 = 1;
-declare exit handler for condname2 set x5 = 1;
+DECLARE x1, x2, x3, x4, x5 int default 0;
+DECLARE condname1 CONDITION FOR SQLSTATE '42000';
+DECLARE condname2 CONDITION FOR SQLSTATE '42000';
+DECLARE CONTINUE HANDLER FOR condname1 set x1 = 1;
+DECLARE CONTINUE HANDLER FOR condname1 set x2 = 1;
+DECLARE EXIT HANDLER FOR condname1 SET x3 = 1;
+DECLARE CONTINUE HANDLER FOR condname2 SET x4 = 1;
+DECLARE EXIT HANDLER FOR condname2 SET x5 = 1;
END//
ERROR 42000: Duplicate handler declared in the same block
DROP PROCEDURE IF EXISTS h1;
@@ -23533,12 +24980,12 @@ Testcase 4.11.41:
DROP PROCEDURE IF EXISTS h1;
CREATE PROCEDURE h1 ()
BEGIN
-declare x1 int default 0;
+DECLARE x1 INT DEFAULT 0;
BEGIN
-declare condname1 condition for sqlstate '00000';
-declare exit handler for sqlstate '00000' set @x = 1;
-set x1 = 1;
-set x1 = 2;
+DECLARE condname1 CONDITION FOR SQLSTATE '00000';
+DECLARE EXIT HANDLER FOR SQLSTATE '00000' SET @x = 1;
+SET x1 = 1;
+SET x1 = 2;
END;
SELECT @x, x1;
END//
@@ -23556,10 +25003,10 @@ DROP TABLE IF EXISTS res_t1;
CREATE PROCEDURE h1()
BEGIN
DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=1;
-insert into res_t1 values('xxx', 'yy');
-set @x=0;
+SET @done=0;
+SET @x=1;
+INSERT INTO res_t1 VALUES('xxx', 'yy');
+SET @x=0;
END//
CALL h1();
ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
@@ -23578,10 +25025,10 @@ DROP TABLE IF EXISTS res_t1;
CREATE PROCEDURE h1()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
-set @done=0;
-set @x=0;
-insert into res_t1 values('xxx', 'yy');
-set @x=1;
+SET @done=0;
+SET @x=0;
+INSERT INTO res_t1 VALUES('xxx', 'yy');
+SET @x=1;
END//
CALL h1();
ERROR 42S02: Table 'db_storedproc.res_t1' doesn't exist
diff --git a/mysql-test/suite/funcs_1/storedproc/param_check.inc b/mysql-test/suite/funcs_1/storedproc/param_check.inc
new file mode 100644
index 00000000000..f6c0b30ab8b
--- /dev/null
+++ b/mysql-test/suite/funcs_1/storedproc/param_check.inc
@@ -0,0 +1,33 @@
+# suite/funcs_1/storedproc/param_check.inc
+#
+# Auxiliary routine to be sourced by
+# suite/funcs_1/t/storedproc.test
+#
+# Purpose:
+# The assignment of float values to objects of type DECIMAL causes
+# conversions and in some cases an adjustment of the value to
+# a border of the value range.
+# Try to reveal that function and procedure parameters get a similar
+# mangling of the value like columns.
+#
+# Variables to be set before sourcing this routine
+# $test_value - value to be checked
+#
+# Created:
+# 2008-08-27 mleich
+#
+
+eval UPDATE t1_aux SET f1 = NULL;
+# Enforce that all user variables have the same data type and initial value.
+SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+
+eval UPDATE t1_aux SET f1 = $test_value;
+SELECT f1 INTO @v1_tab FROM t1_aux;
+eval CALL sproc_1($test_value, @v1_proc);
+eval SET @v1_func = func_1($test_value);
+
+if (`SELECT @v1_tab <> @v1_proc OR @v1_tab <> @v2_proc OR @v1_tab <> @v1_func`)
+{
+ --echo Error: @v1_tab, @v1_proc, @v2_proc, @v1_func are not all equal
+ SELECT @v1_tab, @v1_proc, @v2_proc, @v1_func;
+}
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc.test b/mysql-test/suite/funcs_1/t/innodb_storedproc.test
deleted file mode 100644
index 380fae64fb8..00000000000
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#### suite/funcs_1/t/innodb_storedproc.test
-#
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
---source include/have_innodb.inc
-let $engine_type= innodb;
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
-
---source suite/funcs_1/storedproc/storedproc_master.inc
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc.test b/mysql-test/suite/funcs_1/t/memory_storedproc.test
deleted file mode 100644
index 57f181dc00c..00000000000
--- a/mysql-test/suite/funcs_1/t/memory_storedproc.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#### suite/funcs_1/t/memory_storedproc.test
-#
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
-SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
-let $engine_type= memory;
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
-
---source suite/funcs_1/storedproc/storedproc_master.inc
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc.test b/mysql-test/suite/funcs_1/t/myisam_storedproc.test
deleted file mode 100644
index 379aea11dd6..00000000000
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#### suite/funcs_1/t/myisam_storedproc.test
-#
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
-SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
-let $engine_type= myisam;
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
-
---source suite/funcs_1/storedproc/storedproc_master.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc.test b/mysql-test/suite/funcs_1/t/ndb_storedproc.test
deleted file mode 100644
index 3fbda118357..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc.test
-#
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
---source include/have_ndb.inc
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
-
---source suite/funcs_1/storedproc/storedproc_master.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_0102.test.moved b/mysql-test/suite/funcs_1/t/ndb_trig_0102.test.moved
deleted file mode 100644
index c8bb5b04b24..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_0102.test.moved
+++ /dev/null
@@ -1,16 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# ndb tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb3.inc
-
---source suite/funcs_1/triggers/triggers_0102.inc
-DROP TABLE test.tb3;
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_03.test.moved b/mysql-test/suite/funcs_1/t/ndb_trig_03.test.moved
deleted file mode 100644
index 4e9df0282c6..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_03.test.moved
+++ /dev/null
@@ -1,16 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb3.inc
-
---source suite/funcs_1/triggers/triggers_03.inc
-DROP TABLE test.tb3;
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_0407.test.moved b/mysql-test/suite/funcs_1/t/ndb_trig_0407.test.moved
deleted file mode 100644
index 53c24790c7c..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_0407.test.moved
+++ /dev/null
@@ -1,16 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# ndb tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb3.inc
-
---source suite/funcs_1/triggers/triggers_0407.inc
-DROP TABLE test.tb3;
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_08.test.moved b/mysql-test/suite/funcs_1/t/ndb_trig_08.test.moved
deleted file mode 100644
index 197989137d7..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_08.test.moved
+++ /dev/null
@@ -1,16 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# ndb tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb3.inc
-
---source suite/funcs_1/triggers/triggers_08.inc
-DROP TABLE test.tb3;
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_09.test.moved b/mysql-test/suite/funcs_1/t/ndb_trig_09.test.moved
deleted file mode 100644
index ff26a0cbf21..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_09.test.moved
+++ /dev/null
@@ -1,16 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# ndb tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb3.inc
-
---source suite/funcs_1/triggers/triggers_09.inc
-DROP TABLE test.tb3;
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test.moved b/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test.moved
deleted file mode 100644
index 2adcf0747b7..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test.moved
+++ /dev/null
@@ -1,16 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# ndb tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb3.inc
-
---source suite/funcs_1/triggers/triggers_1011ext.inc
-DROP TABLE test.tb3;
-
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc b/mysql-test/suite/funcs_1/t/storedproc.test
index b740cf38708..d7ef1f2712b 100644
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc
+++ b/mysql-test/suite/funcs_1/t/storedproc.test
@@ -1,25 +1,44 @@
-#### suite/funcs_1/storedproc/storedproc_master.inc
-###########################################################################
-# WL4084: Review and fix all disabled test
-# enabled this test.
-# 2007-Oct-04 Hhunger
+# suite/funcs_1/t/storedproc.test
+#
+# Check general properties of stored procedures.
+#
+# Last Modification:
+# 2008-08-27 mleich - Fix Bug#37744 Expected result of "<engine>_storedproc"
+# test is inconsistent
+# - remove variation of storage engines
+# - restore global sort_buffer_size after some subtest
+#
############################################################################
---enable_query_log
+
+# This test cannot be used for the embedded server because we check here
+# privileges.
+--source include/not_embedded.inc
+
+# It is assumed that the storage engine used for some tables has no impact on
+# the outcome of this test. Therefor we use simply the fastest engine.
+let $engine_type= memory;
+
+--source suite/funcs_1/storedproc/load_sp_tb.inc
+
# ==============================================================================
-let $message= Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
+echo;
+echo
+Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
FUNCTION, ALTER PROCEDURE, ALTER FUNCTION, DROP PROCEDURE, DROP FUNCTION, SHOW
CREATE PROCEDURE, SHOW CREATE FUNCTION, SHOW CREATE PROCEDURE STATUS, SHOW
CREATE FUNCTION STATUS, and CALL statements:;
---source include/show_msg80.inc
+echo --------------------------------------------------------------------------------;
# ------------------------------------------------------------------------------
-let $message= Testcase 4.1.1:
- ---------------
- Ensure that all clauses that should be supported are supported
- CREATE PROCEDURE;
---source include/show_msg80.inc
+echo;
+echo
+Testcase 4.1.1:
+---------------
+Ensure that all clauses that should be supported are supported
+CREATE PROCEDURE;
+echo --------------------------------------------------------------------------------;
USE db_storedproc;
@@ -41,69 +60,73 @@ DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylon
delimiter //;
--error ER_TOO_LONG_IDENT
-CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 tinytext ) language sql deterministic sql security definer comment 'this is simple'
- BEGIN
- set @v1 = f1;
- SELECT @v1, @v1;
+CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 TINYTEXT )
+ LANGUAGE SQL DETERMINISTIC SQL SECURITY DEFINER COMMENT 'this is simple'
+BEGIN
+ SET @v1 = f1;
+ SELECT @v1, @v1;
END//
delimiter ;//
--error ER_TOO_LONG_IDENT
CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
-CREATE PROCEDURE sp1( f1 binary ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- set @v1 = f1;
- SELECT @v1;
+CREATE PROCEDURE sp1( f1 BINARY )
+ LANGUAGE SQL DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ SET @v1 = f1;
+ SELECT @v1;
END//
delimiter ;//
CALL sp1( 34 );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
-CREATE PROCEDURE sp1( f1 blob ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- set @v1 = f1;
- SELECT @v1;
+CREATE PROCEDURE sp1( f1 BLOB )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ set @v1 = f1;
+ SELECT @v1;
END//
delimiter ;//
CALL sp1( 34 );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
-CREATE PROCEDURE sp1( f1 int ) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE PROCEDURE sp1( f1 INT )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set @v1 = f1;
- SELECT @v1;
+ SET @v1 = f1;
+ SELECT @v1;
END//
delimiter ;//
CALL sp1( 34 );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
@@ -111,108 +134,163 @@ DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_TOO_BIG_PRECISION
-CREATE PROCEDURE sp1( f1 decimal(256, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE PROCEDURE sp1( f1 DECIMAL(256, 30) )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set @v1 = f1;
- SELECT @v1;
+ SET @v1 = f1;
+ SELECT @v1;
END//
DROP PROCEDURE IF EXISTS sp1//
--error ER_TOO_BIG_PRECISION
-CREATE PROCEDURE sp1( f1 decimal(66, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE PROCEDURE sp1( f1 DECIMAL(66, 30) )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set @v1 = f1;
- SELECT @v1;
+ SET @v1 = f1;
+ SELECT @v1;
END//
DROP PROCEDURE IF EXISTS sp1//
+delimiter ;//
+
-CREATE PROCEDURE sp1( f1 decimal(60, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
+# Check assignment of float values to DECIMAL(65, 30) parameters of
+# PRODDUREs and FUNCTIONs.
+###########################################################################
+# - The assignment of float values causes that conversions with OS/compiler
+# specific math libraries are involved.
+# --> The content depends on the testing box and simple printing
+# of content will often lead to differences.
+# - We have the same conversions when assigning float values to columns
+# of tables.
+# --> Reveal that we have a consistent behaviour per testing box.
+#
+# Checks that floating point values assigned to objects of type DECIMAL
+# end up with correct DECIMAL values (truncated to a border of the DECIMAL
+# value range or reasonable nearby the floating point value) must be done
+# in other tests.
+###########################################################################
+--disable_warnings
+DROP TABLE IF EXISTS t1_aux;
+DROP PROCEDURE IF EXISTS sproc_1;
+DROP FUNCTION IF EXISTS func_1;
+--enable_warnings
+CREATE TABLE t1_aux ( f1 DECIMAL(65, 30) );
+INSERT INTO t1_aux SET f1 = NULL;
+delimiter //;
+CREATE PROCEDURE sproc_1(f1 DECIMAL(65, 30), OUT f2 DECIMAL(65, 30))
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ SET f2 = NULL;
+ SET f2 = f1;
+ SET @v2_proc = f1;
+END//
+CREATE FUNCTION func_1(f1 DECIMAL(65, 30)) RETURNS DECIMAL(65,30)
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set @v1 = f1;
- SELECT @v1;
+ RETURN f1;
END//
delimiter ;//
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
+--replace_column 5 <modified> 6 <created>
+SHOW FUNCTION STATUS;
-CALL sp1( 17976931340000 );
-
-# switched off due to big differences with (e.g....) sol10-sparc-b
-CALL sp1( 1.797693134e+13 );
---error ER_ILLEGAL_VALUE_FOR_TYPE
-CALL sp1( 1.7976931348623157493578e+308 );
-
-# check all ...E+100 to E-100
-let $digits= 100;
-while ($digits)
+let $test_value = 1.7976931348623157493578e+308;
+--source suite/funcs_1/storedproc/param_check.inc
+#
+# Check all ...E+nnn
+let digits= 100;
+let $run= 1;
+while ($run)
+{
+ let $test_value = 0.1234567890987654321e+$digits;
+ --source suite/funcs_1/storedproc/param_check.inc
+ let $run = `SELECT $digits > 0`;
+ if ($run)
+ {
+ dec $digits;
+ }
+}
+# Check all ...E-nnn
+let digits= 100;
+let $run= 1;
+while ($run)
{
- eval CALL sp1( 0.1234567890987654321e+$digits );
- eval CALL sp1( 0.1234567890987654321e-$digits );
- dec $digits;
+ let $test_value = 0.1234567890987654321e-$digits;
+ --source suite/funcs_1/storedproc/param_check.inc
+ let $run = `SELECT $digits > 0`;
+ if ($run)
+ {
+ dec $digits;
+ }
}
-# check the 2 values which cannot be handled easy in the loop:
-eval CALL sp1( 0.1234567890987654321e+0 );
-eval CALL sp1( 0.1234567890987654321e-0 );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+# Cleanup
+DROP PROCEDURE sproc_1;
+DROP FUNCTION func_1;
+DROP TABLE t1_aux;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- SELECT f1;
+CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ SELECT f1;
END//
delimiter ;//
CALL sp1( "value1" );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
-CREATE PROCEDURE sp1( f1 set("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- SELECT f1;
+CREATE PROCEDURE sp1( f1 SET("value1", "value1") )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ SELECT f1;
END//
delimiter ;//
CALL sp1( "value1, value1" );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
-CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- SELECT f1;
+CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ SELECT f1;
END//
delimiter ;//
CALL sp1( "value1" );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status;
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
-CREATE PROCEDURE sp1( f1 text ) language sql SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) LANGUAGE SQL SELECT f1;
CALL sp1( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status like 'sp1';
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
@@ -221,48 +299,48 @@ DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 text ) deterministic SELECT f1;
CALL sp1( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status like 'sp1';
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
-CREATE PROCEDURE sp1( f1 text ) not deterministic SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) NOT DETERMINISTIC SELECT f1;
CALL sp1( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status like 'sp1';
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
-CREATE PROCEDURE sp1( f1 text ) sql security definer SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) SQL SECURITY DEFINER SELECT f1;
CALL sp1( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status like 'sp1';
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
-CREATE PROCEDURE sp1( f1 text ) sql security invoker SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) SQL SECURITY INVOKER SELECT f1;
CALL sp1( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status like 'sp1';
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
-CREATE PROCEDURE sp1( f1 text ) comment 'this is simple' SELECT f1;
+CREATE PROCEDURE sp1( f1 TEXT ) COMMENT 'this is simple' SELECT f1;
CALL sp1( 'abc' );
---replace_column 5 modified 6 created
-SHOW PROCEDURE status like 'sp1';
+--replace_column 5 <modified> 6 <created>
+SHOW PROCEDURE STATUS LIKE 'sp1';
# cleanup
DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
@@ -281,8 +359,8 @@ let $message= Testcase 4.1.2:
DROP FUNCTION IF EXISTS fn1;
--enable_warnings
-CREATE FUNCTION fn1 (s char(20)) returns char(50)
- return concat('hello, ', s, '!');
+CREATE FUNCTION fn1 (s CHAR(20)) RETURNS CHAR(50)
+ RETURN CONCAT('hello, ', s, '!');
SELECT fn1('world');
--disable_warnings
@@ -290,17 +368,18 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 mediumtext ) returns mediumtext language sql deterministic sql security definer comment 'this is simple'
- BEGIN
- set @v1 = 'hello';
- set f1 = concat( @v1, f1 );
- return f1;
+CREATE FUNCTION fn1( f1 MEDIUMTEXT ) RETURNS MEDIUMTEXT
+ LANGUAGE SQL DETERMINISTIC SQL SECURITY DEFINER COMMENT 'this is simple'
+BEGIN
+ SET @v1 = 'hello';
+ SET f1 = CONCAT( @v1, f1 );
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( ' world');
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -308,16 +387,17 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql not deterministic sql security invoker comment 'this is simple'
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set f1 = 1 + f1;
- return f1;
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -327,10 +407,11 @@ DROP FUNCTION IF EXISTS fn1;
delimiter //;
# 1425: Too big scale 63 specified for column ''. Maximum is 30.
--error ER_TOO_BIG_SCALE
-CREATE FUNCTION fn1( f1 decimal(63, 31) ) returns decimal(63, 31) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE FUNCTION fn1( f1 DECIMAL(63, 31) ) RETURNS DECIMAL(63, 31)
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set f1 = 1000000 + f1;
- return f1;
+ SET f1 = 1000000 + f1;
+ RETURN f1;
END//
delimiter ;//
@@ -338,16 +419,17 @@ delimiter ;//
SELECT fn1( 1.3326e+8 );
delimiter //;
-CREATE FUNCTION fn1( f1 decimal(63, 30) ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
+CREATE FUNCTION fn1( f1 DECIMAL(63, 30) ) RETURNS DECIMAL(63, 30)
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
- set f1 = 1000000 + f1;
- return f1;
+ SET f1 = 1000000 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 1.3326e+8 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -355,9 +437,10 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 enum("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- return f1;
+CREATE FUNCTION fn1( f1 ENUM("value1", "value1") ) RETURNS DECIMAL(63, 30)
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ RETURN f1;
END//
delimiter ;//
@@ -370,7 +453,7 @@ delimiter ;//
SELECT fn1( "value1" );
--enable_warnings
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -378,9 +461,10 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 set("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
- BEGIN
- return f1;
+CREATE FUNCTION fn1( f1 SET("value1", "value1") ) RETURNS DECIMAL(63, 30)
+ LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
+BEGIN
+ RETURN f1;
END//
delimiter ;//
@@ -393,7 +477,7 @@ delimiter ;//
SELECT fn1( "value1, value1" );
--enable_warnings
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -401,16 +485,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql
- BEGIN
- set f1 = 1 + f1;
- return f1;
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT LANGUAGE SQL
+BEGIN
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -418,16 +502,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint deterministic
- BEGIN
- set f1 = 1 + f1;
- return f1;
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT DETERMINISTIC
+BEGIN
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -435,16 +519,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint not deterministic
- BEGIN
- set f1 = 1 + f1;
- return f1;
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT NOT DETERMINISTIC
+BEGIN
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -452,17 +536,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
- sql security definer
- BEGIN
- set f1 = 1 + f1;
- return f1;
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT SQL SECURITY DEFINER
+BEGIN
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -470,17 +553,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
- sql security invoker
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT SQL SECURITY INVOKER
BEGIN
- set f1 = 1 + f1;
- return f1;
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
@@ -488,16 +570,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
-CREATE FUNCTION fn1( f1 smallint ) returns smallint
- comment 'this is simple'
+CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT COMMENT 'this is simple'
BEGIN
- set f1 = 1 + f1;
- return f1;
+ SET f1 = 1 + f1;
+ RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
---replace_column 5 modified 6 created
+
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
# cleanup
@@ -517,7 +599,7 @@ DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1 (f1 char(20) )
SELECT * from t1 where f2 = f1;
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show CREATE PROCEDURE sp1;
# cleanup
@@ -536,7 +618,7 @@ DROP FUNCTION IF EXISTS fn1;
CREATE FUNCTION fn1 (s char(20)) returns char(50)
return concat('hello, ', s, '!');
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show CREATE FUNCTION fn1;
# cleanup
@@ -552,7 +634,7 @@ SHOW PROCEDURE status;
CREATE PROCEDURE sp5()
SELECT * from t1;
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp5';
# cleanup
@@ -573,7 +655,7 @@ BEGIN
END//
delimiter ;//
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn5';
# cleanup
@@ -762,7 +844,7 @@ disconnect u_1;
connection default;
--source suite/funcs_1/include/show_connection.inc
-alter procedure sp11 sql security definer;
+alter procedure sp11 sql security DEFINER;
--replace_column 13 created 14 modified
SELECT security_type from mysql.proc where specific_name='sp11';
CALL sp11();
@@ -791,7 +873,7 @@ SELECT security_type from mysql.proc where specific_name='fn12';
--replace_column 13 created 14 modified
SELECT fn12();
-alter function fn12 sql security definer;
+alter function fn12 sql security DEFINER;
SELECT security_type from mysql.proc where specific_name='fn12';
--replace_column 13 created 14 modified
SELECT fn12();
@@ -2494,12 +2576,12 @@ CALL db_storedproc.sp1();
SELECT db_storedproc.sp1();
USE db_storedproc;
-alter procedure sp1 sql security definer;
+alter procedure sp1 sql security DEFINER;
CALL db_storedproc.sp1();
SELECT db_storedproc.sp1();
-alter function sp1 sql security definer;
+alter function sp1 sql security DEFINER;
--sorted_result
SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
CALL db_storedproc.sp1();
@@ -2527,8 +2609,8 @@ DROP DATABASE IF EXISTS db_storedproc_3122;
CREATE DATABASE db_storedproc_3122;
USE db_storedproc;
-set @x=null;
-set @y=null;
+SET @x = NULL;
+SET @y = NULL;
DROP PROCEDURE IF EXISTS sp1;
DROP FUNCTION IF EXISTS sp1;
DROP PROCEDURE IF EXISTS db_storedproc_3122.sp1;
@@ -2536,13 +2618,13 @@ DROP FUNCTION IF EXISTS db_storedproc_3122.sp1;
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
- set @x= 1;
+ SET @x = 1;
SELECT @x;
END//
delimiter ;//
# FIXME ps-protocol vs. normal difference when returning float instead of double
-CREATE FUNCTION db_storedproc_3122.sp1() returns double return 2.2;
+CREATE FUNCTION db_storedproc_3122.sp1() RETURNS DOUBLE RETURN 2.2;
CALL sp1();
SELECT db_storedproc_3122.sp1();
USE db_storedproc_3122;
@@ -2550,20 +2632,20 @@ CALL sp1();
delimiter //;
CREATE PROCEDURE sp1 ()
BEGIN
- set @x= 3;
+ SET @x = 3;
SELECT @x;
END//
delimiter ;//
-CREATE FUNCTION db_storedproc.sp1() returns double return 4.4;
+CREATE FUNCTION db_storedproc.sp1() RETURNS DOUBLE RETURN 4.4;
CALL sp1();
SELECT db_storedproc.sp1();
-alter procedure db_storedproc_3122.sp1 sql security invoker;
-alter function sp1 sql security invoker;
+ALTER PROCEDURE db_storedproc_3122.sp1 SQL SECURITY INVOKER;
+ALTER FUNCTION sp1 SQL SECURITY INVOKER;
--sorted_result
-SELECT db, name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
+SELECT db, name, type, security_type FROM mysql.proc WHERE db LIKE 'db_storedproc%' AND specific_name='sp1';
CALL db_storedproc.sp1();
@@ -2607,11 +2689,11 @@ CREATE FUNCTION sp1 () returns int return 4;
alter procedure sp1 sql security invoker comment 'this is a procedure';
alter function sp1 sql security invoker comment 'this is a function';
-alter procedure sp1 sql security definer;
-alter function sp1 sql security definer;
---replace_column 5 modified 6 created
+alter procedure sp1 sql security DEFINER;
+alter function sp1 sql security DEFINER;
+--replace_column 5 <modified> 6 <created>
show CREATE PROCEDURE sp1;
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show CREATE FUNCTION sp1;
# clean up
@@ -16044,26 +16126,28 @@ let $message= Testcase 4.2.28:;
# declared within a stored procedures definition, as well as to every
# appropriate global server variable.
-set @x=0;
-set @y=0;
+SET @x = 0;
+SET @y = 0;
DROP PROCEDURE IF EXISTS sp1;
+SET @start_global_value = @@GLOBAL.sort_buffer_size;
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
- declare continue handler for sqlstate '42000' set @x2 = 1;
- set session sort_buffer_size = 10 * 1024 * 1024;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @x2 = 1;
+ SET SESSION SORT_BUFFER_SIZE = 10 * 1024 * 1024;
SELECT @@sort_buffer_size;
- set @x = 4;
- set @y = 3;
- set global sort_buffer_size = 2 * 1024 * 1024;
+ SET @x = 4;
+ SET @y = 3;
+ SET GLOBAL SORT_BUFFER_SIZE = 2 * 1024 * 1024;
SELECT @@sort_buffer_size;
- set @@sort_buffer_size = 10 * 1024 * 1024;
+ SET @@sort_buffer_size = 10 * 1024 * 1024;
SELECT @@sort_buffer_size;
END//
delimiter ;//
CALL sp1();
SELECT @x, @y;
+SET @@GLOBAL.sort_buffer_size = @start_global_value;
# ------------------------------------------------------------------------------
@@ -19541,11 +19625,11 @@ DROP DATABASE IF EXISTS d2;
USE d1;
-CREATE PROCEDURE sp8 ( n char(20) ) sql security definer comment 'initial'
+CREATE PROCEDURE sp8 ( n char(20) ) sql security DEFINER comment 'initial'
SELECT * from t1 where t1.f1 = n;
USE d2;
- alter procedure d1.sp8 sql security definer comment 'updated';
+ alter procedure d1.sp8 sql security DEFINER comment 'updated';
--replace_column 13 modified 14 created
SELECT * from mysql.proc where specific_name='sp8' and db='d1';
@@ -19574,7 +19658,7 @@ END//
delimiter ;//
USE d2;
- alter function d1.fn2 sql security definer comment 'updated';
+ alter function d1.fn2 sql security DEFINER comment 'updated';
--replace_column 13 modified 14 created
SELECT * from mysql.proc where specific_name='fn2' and db='d1';
@@ -26986,13 +27070,13 @@ show CREATE PROCEDURE sp6b;
show CREATE PROCEDURE sp6c;
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6a';
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6b';
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6c';
# cleanup
@@ -27020,7 +27104,7 @@ BEGIN
END//
delimiter ;//
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6';
# cleanup
@@ -27073,7 +27157,7 @@ CREATE FUNCTION sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
END//
delimiter ;//
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show function status like 'sp6';
# cleanup
@@ -27154,7 +27238,7 @@ CREATE FUNCTION fn1 (i1 real) returns real
END//
delimiter ;//
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show procedure status like 'fn1';
# cleanup
@@ -27188,7 +27272,7 @@ BEGIN
END//
delimiter ;//
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
# cleanup
@@ -27306,7 +27390,7 @@ BEGIN
END//
delimiter ;//
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show function status like 'sp6';
# cleanup
@@ -27347,7 +27431,7 @@ delimiter ;//
alter procedure sp6 comment 'this is a new comment';
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6';
# cleanup
@@ -27401,7 +27485,7 @@ delimiter ;//
alter function fn1 sql security invoker;
alter function fn1 comment 'this is a function 3242#@%$#@';
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
show function status like 'fn1';
# cleanup
@@ -27481,7 +27565,7 @@ delimiter ;//
DROP PROCEDURE sp6;
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6';
@@ -27530,7 +27614,7 @@ delimiter ;//
DROP FUNCTION fn1;
---replace_column 5 modified 6 created
+--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
@@ -29297,11 +29381,11 @@ let $message= Testcase 4.11.40:;
--disable_warnings
DROP PROCEDURE IF EXISTS h1;
-drop table IF EXISTS res_t1;
+DROP TABLE IF EXISTS res_t1;
--enable_warnings
- create table res_t1(w char unique, x char);
- insert into res_t1 values ('a', 'b');
+CREATE TABLE res_t1(w CHAR UNIQUE, x CHAR);
+INSERT INTO res_t1 VALUES ('a', 'b');
# suppressed--error for having two similar handlers in the same scope
@@ -29309,14 +29393,14 @@ delimiter //;
--error ER_SP_DUP_HANDLER
CREATE PROCEDURE h1 ()
BEGIN
- declare x1, x2, x3, x4, x5 int default 0;
- declare condname1 condition for sqlstate '42000';
- declare condname2 condition for sqlstate '42000';
- declare continue handler for condname1 set x1 = 1;
- declare continue handler for condname1 set x2 = 1;
- declare exit handler for condname1 set x3 = 1;
- declare continue handler for condname2 set x4 = 1;
- declare exit handler for condname2 set x5 = 1;
+ DECLARE x1, x2, x3, x4, x5 int default 0;
+ DECLARE condname1 CONDITION FOR SQLSTATE '42000';
+ DECLARE condname2 CONDITION FOR SQLSTATE '42000';
+ DECLARE CONTINUE HANDLER FOR condname1 set x1 = 1;
+ DECLARE CONTINUE HANDLER FOR condname1 set x2 = 1;
+ DECLARE EXIT HANDLER FOR condname1 SET x3 = 1;
+ DECLARE CONTINUE HANDLER FOR condname2 SET x4 = 1;
+ DECLARE EXIT HANDLER FOR condname2 SET x5 = 1;
END//
delimiter ;//
@@ -29343,14 +29427,14 @@ DROP PROCEDURE IF EXISTS h1;
delimiter //;
CREATE PROCEDURE h1 ()
BEGIN
- declare x1 int default 0;
- BEGIN
- declare condname1 condition for sqlstate '00000';
- declare exit handler for sqlstate '00000' set @x = 1;
- set x1 = 1;
- set x1 = 2;
- END;
- SELECT @x, x1;
+ DECLARE x1 INT DEFAULT 0;
+ BEGIN
+ DECLARE condname1 CONDITION FOR SQLSTATE '00000';
+ DECLARE EXIT HANDLER FOR SQLSTATE '00000' SET @x = 1;
+ SET x1 = 1;
+ SET x1 = 2;
+ END;
+ SELECT @x, x1;
END//
delimiter ;//
@@ -29378,11 +29462,11 @@ DROP TABLE IF EXISTS res_t1;
delimiter //;
CREATE PROCEDURE h1()
BEGIN
- DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
- set @done=0;
- set @x=1;
- insert into res_t1 values('xxx', 'yy');
- set @x=0;
+ DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
+ SET @done=0;
+ SET @x=1;
+ INSERT INTO res_t1 VALUES('xxx', 'yy');
+ SET @x=0;
END//
delimiter ;//
@@ -29407,11 +29491,11 @@ DROP TABLE IF EXISTS res_t1;
delimiter //;
CREATE PROCEDURE h1()
BEGIN
- DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
- set @done=0;
- set @x=0;
- insert into res_t1 values('xxx', 'yy');
- set @x=1;
+ DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
+ SET @done=0;
+ SET @x=0;
+ INSERT INTO res_t1 VALUES('xxx', 'yy');
+ SET @x=1;
END//
delimiter ;//
diff --git a/mysql-test/suite/funcs_1/views/func_view.inc b/mysql-test/suite/funcs_1/views/func_view.inc
index cee63bfb605..6679a0f898f 100644
--- a/mysql-test/suite/funcs_1/views/func_view.inc
+++ b/mysql-test/suite/funcs_1/views/func_view.inc
@@ -158,10 +158,16 @@ DROP VIEW IF EXISTS v1;
--disable_query_log
# Storage for the SELECTs to be used for the VIEW definition
+# Attention: my_select must be no too small because a statement like
+# SELECT LOAD_FILE(< file in MYSQLTEST_VARDIR >)
+# AS my_col,
+# id FROM t1_values';
+# might be a very long
+# Bug#38427 "Data too long" ... tests "<ENGINE>_func_view" fail
CREATE TABLE t1_selects
(
id BIGINT AUTO_INCREMENT,
- my_select VARCHAR(200) NOT NULL,
+ my_select VARCHAR(1000) NOT NULL,
disable_result ENUM('Yes','No') NOT NULL default 'No',
PRIMARY KEY(id),
UNIQUE (my_select)
diff --git a/mysql-test/suite/ndb/r/ndb_alter_table.result b/mysql-test/suite/ndb/r/ndb_alter_table.result
index 5798db73403..35b983e1901 100644
--- a/mysql-test/suite/ndb/r/ndb_alter_table.result
+++ b/mysql-test/suite/ndb/r/ndb_alter_table.result
@@ -354,16 +354,52 @@ select * from t1 where a = 12;
a b c
12 403 NULL
drop table t1;
-create table t1 (a int not null, b varchar(10)) engine=ndb;
-show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+create table t1(a int not null) engine=ndb;
+$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+PRIMARY KEY($PK) - UniqueHashIndex
+insert into t1 values (1),(2),(3);
alter table t1 add primary key (a);
-show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 a A 0 NULL NULL BTREE
+a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+PRIMARY KEY(a) - UniqueHashIndex
+PRIMARY(a) - OrderedIndex
+update t1 set a = 17 where a = 1;
+select * from t1 order by a;
+a
+2
+3
+17
alter table t1 drop primary key;
-show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+PRIMARY KEY($PK) - UniqueHashIndex
+update t1 set a = 1 where a = 17;
+select * from t1 order by a;
+a
+1
+2
+3
+drop table t1;
+create table t1(a int not null) engine=ndb;
+$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+PRIMARY KEY($PK) - UniqueHashIndex
+insert into t1 values (1),(2),(3);
+create unique index pk on t1(a);
+a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+PRIMARY KEY(a) - UniqueHashIndex
+update t1 set a = 17 where a = 1;
+select * from t1 order by a;
+a
+2
+3
+17
+alter table t1 drop index pk;
+$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+PRIMARY KEY($PK) - UniqueHashIndex
+update t1 set a = 1 where a = 17;
+select * from t1 order by a;
+a
+1
+2
+3
drop table t1;
create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
show create table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result
index 5ce2d860e7d..bc15fd30413 100644
--- a/mysql-test/suite/ndb/r/ndb_partition_key.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_key.result
@@ -97,7 +97,8 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL DEFAULT '0',
`d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`) USING HASH
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (b) */
DROP TABLE t1;
CREATE TABLE t1 (a int not null primary key)
PARTITION BY KEY(a)
@@ -122,19 +123,28 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
alter table t1 engine=heap;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
alter table t1 engine=ndb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
alter table t1 engine=heap remove partitioning;
show create table t1;
Table Create Table
@@ -148,7 +158,10 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
alter table t1
partition by key (a)
(partition p0 engine=ndb, partition p1 engine=ndb);
@@ -156,7 +169,10 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
alter table t1 remove partitioning;
show create table t1;
Table Create Table
@@ -174,7 +190,10 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
drop table t1;
CREATE TABLE t1 (
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
diff --git a/mysql-test/suite/ndb/r/ndb_partition_range.result b/mysql-test/suite/ndb/r/ndb_partition_range.result
index 198898879df..83eff9ea2ee 100644
--- a/mysql-test/suite/ndb/r/ndb_partition_range.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_range.result
@@ -123,7 +123,11 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL,
PRIMARY KEY (`b`),
UNIQUE KEY `a` (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (b)
+(PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster,
+ PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
drop table t1;
CREATE TABLE t1
(id MEDIUMINT NOT NULL,
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
index 6102d182684..c638c7b4774 100644
--- a/mysql-test/suite/ndb/t/disabled.def
+++ b/mysql-test/suite/ndb/t/disabled.def
@@ -12,6 +12,5 @@
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
-ndb_index_ordered : Bug#38370 The test ndb.ndb_index_ordered fails with the community features on
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/suite/ndb/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test
index 082fe726927..cbd941b8a9c 100644
--- a/mysql-test/suite/ndb/t/ndb_alter_table.test
+++ b/mysql-test/suite/ndb/t/ndb_alter_table.test
@@ -411,13 +411,32 @@ select * from t1 where a = 12;
drop table t1;
# some other ALTER combinations
-# add/drop pk
-create table t1 (a int not null, b varchar(10)) engine=ndb;
-show index from t1;
+# Check add/drop primary key (not supported on-line)
+create table t1(a int not null) engine=ndb;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
+insert into t1 values (1),(2),(3);
alter table t1 add primary key (a);
-show index from t1;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
+update t1 set a = 17 where a = 1;
+select * from t1 order by a;
alter table t1 drop primary key;
-show index from t1;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
+update t1 set a = 1 where a = 17;
+select * from t1 order by a;
+drop table t1;
+
+# bug#31233 mysql_alter_table() fails to drop UNIQUE KEY
+create table t1(a int not null) engine=ndb;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
+insert into t1 values (1),(2),(3);
+create unique index pk on t1(a);
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
+update t1 set a = 17 where a = 1;
+select * from t1 order by a;
+alter table t1 drop index pk;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
+update t1 set a = 1 where a = 17;
+select * from t1 order by a;
drop table t1;
# alter .. alter
diff --git a/mysql-test/suite/ndb/t/ndb_restore_print.test b/mysql-test/suite/ndb/t/ndb_restore_print.test
index 6dbbfdf5933..9a880f8968c 100644
--- a/mysql-test/suite/ndb/t/ndb_restore_print.test
+++ b/mysql-test/suite/ndb/t/ndb_restore_print.test
@@ -134,10 +134,14 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
--let ndb_restore_filter=test t1
--source include/ndb_backup_print.inc
---exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
--let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append
--let ndb_restore_filter=test
@@ -156,10 +160,10 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
--source include/show_msg.inc
--exec sort $MYSQLTEST_VARDIR/tmp/t4.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt
---exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
# now test some other datatypes
drop table t1;
diff --git a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
index c82fe560121..768aa86c832 100644
--- a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
+++ b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
@@ -175,7 +175,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 4 */
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -184,7 +186,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c3)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -193,7 +198,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (c3)
+(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4;
Table Create Table
t4 CREATE TABLE `t4` (
@@ -202,7 +211,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 2 */
SHOW CREATE TABLE test.t5;
Table Create Table
t5 CREATE TABLE `t5` (
@@ -211,7 +222,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (pk1)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6;
Table Create Table
t6 CREATE TABLE `t6` (
@@ -220,7 +234,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (pk1)
+(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
@@ -341,7 +358,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 4 */
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -350,7 +369,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c3)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -359,7 +381,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (c3)
+(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4;
Table Create Table
t4 CREATE TABLE `t4` (
@@ -368,7 +394,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 2 */
SHOW CREATE TABLE test.t5;
Table Create Table
t5 CREATE TABLE `t5` (
@@ -377,7 +405,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (pk1)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6;
Table Create Table
t6 CREATE TABLE `t6` (
@@ -386,7 +417,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (pk1)
+(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
diff --git a/mysql-test/suite/ndb_team/t/ndb_autodiscover.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
index e25bf4518a8..a2fb0c3b25f 100644
--- a/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
+++ b/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
@@ -113,7 +113,7 @@ flush tables;
# Remove the frm file from disk
--remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm
---error 1050
+--error ER_TABLE_EXISTS_ERROR
create table t3(
id int not null primary key,
name char(20), a int, b float, c char(24)
@@ -204,13 +204,13 @@ system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS
#
# Test that correct error is returned
---error 1146
+--error ER_NO_SUCH_TABLE
select * from t4;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from t4;
show status like 'handler_discover%';
---error 1051
+--error ER_BAD_TABLE_ERROR
drop table t4;
create table t4(
@@ -223,14 +223,14 @@ select * from t4;
# Remove the table from NDB
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from t4;
drop table if exists t4;
# Test that dropping a table that does not exists
# on disk or in NDB gives same result as above
---error 1051
+--error ER_BAD_TABLE_ERROR
drop table t5;
drop table if exists t5;
@@ -257,7 +257,7 @@ system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS
SHOW TABLES;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from t4;
#######################################################
@@ -342,9 +342,9 @@ show status like 'handler_discover%';
# Check that t3 or t5 can't be created
# frm files for these tables is stilll on disk
---error 1050
+--error ER_TABLE_EXISTS_ERROR
create table t3(a int);
---error 1050
+--error ER_TABLE_EXISTS_ERROR
create table t5(a int);
SHOW TABLES LIKE 't%';
@@ -462,7 +462,7 @@ show tables;
create database test2;
use test2;
show tables;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from t1;
create table t2 (b int,c longblob) engine=ndb;
use test;
@@ -487,7 +487,7 @@ create table t1 (a int primary key) engine=ndb;
select * from t1;
--exec $NDB_MGM --no-defaults -e "all restart -n" > /dev/null
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --not-started > /dev/null
---error 1015
+--error ER_CANT_LOCK
select * from t1;
--exec $NDB_MGM --no-defaults -e "all start" > /dev/null
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults > /dev/null
@@ -503,17 +503,17 @@ drop database test_only_ndb_tables;
# discovered( for example a table created via NDBAPI)
# Test disabled since it doesn't work on case insensitive systems
-#--error 1050
+#--error ER_TABLE_EXISTS_ERROR
#CREATE TABLE sys.SYSTAB_0 (a int);
-#--error 1105
+#--error ER_UNKNOWN_ERROR
#select * from sys.SYSTAB_0;
#CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
#show warnings;
-#--error 1105
+#--error ER_UNKNOWN_ERROR
#select * from sys.SYSTAB_0;
-#--error 1051
+#--error ER_BAD_TABLE_ERROR
#drop table sys.SYSTAB_0;
#drop table IF EXISTS sys.SYSTAB_0;
diff --git a/mysql-test/suite/parts/inc/partition_alter2.inc b/mysql-test/suite/parts/inc/partition_alter2_1.inc
index 3960b8e8a09..92cbc7ba6e6 100644
--- a/mysql-test/suite/parts/inc/partition_alter2.inc
+++ b/mysql-test/suite/parts/inc/partition_alter2_1.inc
@@ -1,16 +1,17 @@
################################################################################
-# inc/partition_alter2.inc #
+# inc/partition_alter2_1.inc #
# #
# Purpose: #
# Tests where the columns used within the partitioning function are altered. #
# This routine is only useful for the partition_<feature>_<engine> tests. .#
+# Part 1: increasing size of column
# #
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-03-05 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: MattiasJ #
+# Change Date: 2008-09-08 #
+# Change: Splitted the test in two different parts (increasing/decreasing col) #
################################################################################
--echo
@@ -140,133 +141,6 @@ let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
---echo
---echo #========================================================================
---echo # 2 Decrease the size of the column used in the partitioning
---echo # function and/or PRIMARY KEY and/or UNIQUE INDEX
---echo #========================================================================
---echo #------------------------------------------------------------------------
---echo # 2.1 ALTER column f_int2 not used in partitioning function
---echo #------------------------------------------------------------------------
-# Rule: Only f_int1 is used within the partitioning function
-# ---> inc/partition_alter_11.inc
-let $alter= ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
---echo # 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
-let $unique= ;
---source suite/parts/inc/partition_alter_11.inc
-#
-if ($do_pk_tests)
-{
- # The value of the direct following test is maybe covered by the test with
- # the PRIMARY KEY containing two columns.
- if ($more_pk_ui_tests)
- {
- --echo # 2.1.2 PRIMARY KEY exists
- let $unique= , PRIMARY KEY (f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- }
- let $unique= , PRIMARY KEY (f_int1,f_int2);
- --source suite/parts/inc/partition_alter_11.inc
- let $unique= , PRIMARY KEY (f_int2,f_int1);
- --source suite/parts/inc/partition_alter_11.inc
-}
-#
---echo # 2.1.3 UNIQUE INDEX exists
-# The value of the direct following test is maybe covered by the test with
-# the UNIQUE INDEX containing two columns.
-if ($more_pk_ui_tests)
-{
- let $unique= , UNIQUE INDEX uidx1 (f_int1);
- --source suite/parts/inc/partition_alter_11.inc
-}
-let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2);
---source suite/parts/inc/partition_alter_11.inc
-let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1);
---source suite/parts/inc/partition_alter_11.inc
-#
-if ($more_pk_ui_tests)
-{
- # The value of the tests 2.2 is maybe covered by the tests 2.3
- --echo #------------------------------------------------------------------------
- --echo # 2.2 ALTER column f_int1 used in partitioning function
- --echo #------------------------------------------------------------------------
- # Rule: Only f_int1 is used within the partitioning function
- # ---> inc/partition_alter_11.inc
- let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT;
- --echo # 2.2.1 no PRIMARY KEY or UNIQUE INDEX exists
- let $unique= ;
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
- #
- if ($do_pk_tests)
- {
- --echo # 2.2.2 PRIMARY KEY exists
- let $unique= , PRIMARY KEY (f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- let $unique= , PRIMARY KEY (f_int1,f_int2);
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
- let $unique= , PRIMARY KEY (f_int2,f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
- }
- #
- --echo # 2.2.3 UNIQUE INDEX exists
- let $unique= , UNIQUE INDEX uidx (f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
- let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
-}
-#
---echo #------------------------------------------------------------------------
---echo # 2.3 ALTER column f_int1 and f_int2 used in partitioning function
---echo #------------------------------------------------------------------------
-# Rule: f_int1 and f_int2 is used within the partitioning function
-# ---> inc/partition_alter_13.inc
-let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
---echo # 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
-let $unique= ;
---source suite/parts/inc/partition_alter_11.inc
---source suite/parts/inc/partition_alter_13.inc
-#
-if ($do_pk_tests)
-{
- --echo # 2.3.2 PRIMARY KEY exists
- # The value of the direct following test is maybe covered by the test with
- # the PRIMARY KEY containing two columns.
- if ($more_pk_ui_tests)
- {
- let $unique= , PRIMARY KEY (f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- }
- let $unique= , PRIMARY KEY (f_int1,f_int2);
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
- let $unique= , PRIMARY KEY (f_int2,f_int1);
- --source suite/parts/inc/partition_alter_11.inc
- --source suite/parts/inc/partition_alter_13.inc
-}
-#
---echo # 2.3.3 UNIQUE INDEX exists
-# The value of the direct following test is maybe covered by the test with
-# the UNIQUE INDEX containing two columns.
-if ($more_pk_ui_tests)
-{
- let $unique= , UNIQUE INDEX uidx (f_int1);
- --source suite/parts/inc/partition_alter_11.inc
-}
-let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
---source suite/parts/inc/partition_alter_11.inc
---source suite/parts/inc/partition_alter_13.inc
-let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
---source suite/parts/inc/partition_alter_11.inc
---source suite/parts/inc/partition_alter_13.inc
-#
-
if (0)
{
--echo
diff --git a/mysql-test/suite/parts/inc/partition_alter2_2.inc b/mysql-test/suite/parts/inc/partition_alter2_2.inc
new file mode 100644
index 00000000000..829b0ee661c
--- /dev/null
+++ b/mysql-test/suite/parts/inc/partition_alter2_2.inc
@@ -0,0 +1,159 @@
+################################################################################
+# inc/partition_alter2_2.inc #
+# #
+# Purpose: #
+# Tests where the columns used within the partitioning function are altered. #
+# This routine is only useful for the partition_<feature>_<engine> tests. .#
+# Part 2: decreasing size of column
+# #
+#------------------------------------------------------------------------------#
+# Original Author: mleich #
+# Original Date: 2006-03-05 #
+# Change Author: MattiasJ #
+# Change Date: 2008-09-08 #
+# Change: Splitted the test in two different parts (increasing/decreasing col) #
+################################################################################
+
+--echo
+--echo #========================================================================
+--echo # 2 Decrease the size of the column used in the partitioning
+--echo # function and/or PRIMARY KEY and/or UNIQUE INDEX
+--echo #========================================================================
+--echo #------------------------------------------------------------------------
+--echo # 2.1 ALTER column f_int2 not used in partitioning function
+--echo #------------------------------------------------------------------------
+# Rule: Only f_int1 is used within the partitioning function
+# ---> inc/partition_alter_11.inc
+let $alter= ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
+--echo # 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+let $unique= ;
+--source suite/parts/inc/partition_alter_11.inc
+#
+if ($do_pk_tests)
+{
+ # The value of the direct following test is maybe covered by the test with
+ # the PRIMARY KEY containing two columns.
+ if ($more_pk_ui_tests)
+ {
+ --echo # 2.1.2 PRIMARY KEY exists
+ let $unique= , PRIMARY KEY (f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ }
+ let $unique= , PRIMARY KEY (f_int1,f_int2);
+ --source suite/parts/inc/partition_alter_11.inc
+ let $unique= , PRIMARY KEY (f_int2,f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+}
+#
+--echo # 2.1.3 UNIQUE INDEX exists
+# The value of the direct following test is maybe covered by the test with
+# the UNIQUE INDEX containing two columns.
+if ($more_pk_ui_tests)
+{
+ let $unique= , UNIQUE INDEX uidx1 (f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+}
+let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2);
+--source suite/parts/inc/partition_alter_11.inc
+let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1);
+--source suite/parts/inc/partition_alter_11.inc
+#
+if ($more_pk_ui_tests)
+{
+ # The value of the tests 2.2 is maybe covered by the tests 2.3
+ --echo #------------------------------------------------------------------------
+ --echo # 2.2 ALTER column f_int1 used in partitioning function
+ --echo #------------------------------------------------------------------------
+ # Rule: Only f_int1 is used within the partitioning function
+ # ---> inc/partition_alter_11.inc
+ let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT;
+ --echo # 2.2.1 no PRIMARY KEY or UNIQUE INDEX exists
+ let $unique= ;
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+ #
+ if ($do_pk_tests)
+ {
+ --echo # 2.2.2 PRIMARY KEY exists
+ let $unique= , PRIMARY KEY (f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ let $unique= , PRIMARY KEY (f_int1,f_int2);
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+ let $unique= , PRIMARY KEY (f_int2,f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+ }
+ #
+ --echo # 2.2.3 UNIQUE INDEX exists
+ let $unique= , UNIQUE INDEX uidx (f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+ let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+}
+#
+--echo #------------------------------------------------------------------------
+--echo # 2.3 ALTER column f_int1 and f_int2 used in partitioning function
+--echo #------------------------------------------------------------------------
+# Rule: f_int1 and f_int2 is used within the partitioning function
+# ---> inc/partition_alter_13.inc
+let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+--echo # 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
+let $unique= ;
+--source suite/parts/inc/partition_alter_11.inc
+--source suite/parts/inc/partition_alter_13.inc
+#
+if ($do_pk_tests)
+{
+ --echo # 2.3.2 PRIMARY KEY exists
+ # The value of the direct following test is maybe covered by the test with
+ # the PRIMARY KEY containing two columns.
+ if ($more_pk_ui_tests)
+ {
+ let $unique= , PRIMARY KEY (f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ }
+ let $unique= , PRIMARY KEY (f_int1,f_int2);
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+ let $unique= , PRIMARY KEY (f_int2,f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+ --source suite/parts/inc/partition_alter_13.inc
+}
+#
+--echo # 2.3.3 UNIQUE INDEX exists
+# The value of the direct following test is maybe covered by the test with
+# the UNIQUE INDEX containing two columns.
+if ($more_pk_ui_tests)
+{
+ let $unique= , UNIQUE INDEX uidx (f_int1);
+ --source suite/parts/inc/partition_alter_11.inc
+}
+let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
+--source suite/parts/inc/partition_alter_11.inc
+--source suite/parts/inc/partition_alter_13.inc
+let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
+--source suite/parts/inc/partition_alter_11.inc
+--source suite/parts/inc/partition_alter_13.inc
+#
+
+if (0)
+{
+--echo
+--echo #========================================================================
+--echo # 3 ALTER the type of the column used in the partitioning
+--echo # function and/or PRIMARY KEY and/or UNIQUE INDEX
+--echo # INTEGER --> FLOAT
+--echo # INTEGER --> DECIMAL
+--echo # INTEGER --> VARCHAR
+--echo # mleich: I assume that at least the first two variants are of
+--echo # some interest. But I am unsure if the server allows such
+--echo # conversions. I also think that such operations have a
+--echo # conversions very small likelihood.
+--echo # To be implemented.
+--echo #========================================================================
+}
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc
new file mode 100644
index 00000000000..5e9ad47aa2e
--- /dev/null
+++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc
@@ -0,0 +1,628 @@
+# inc/partition_auto_increment.inc
+#
+# auto_increment test
+# used variables: $engine
+#
+
+-- disable_warnings
+DROP TABLE IF EXISTS t1;
+-- enable_warnings
+
+-- echo # test without partitioning for reference
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ENGINE=$engine;
+SHOW CREATE TABLE t1;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (0);
+-- error 0, ER_DUP_KEY, ER_DUP_ENTRY
+INSERT INTO t1 VALUES (5), (16);
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+if (!$skip_update)
+{
+# InnoDB Does not handle this correctly, see bug#14793, bug#21641
+ UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+ UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+ FLUSH TABLES;
+ UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+ -- error 0, ER_BAD_NULL_ERROR
+ UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+ INSERT INTO t1 VALUES (NULL);
+ INSERT INTO t1 VALUES (NULL);
+}
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ENGINE=$engine;
+SHOW CREATE TABLE t1;
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+if (!$skip_delete)
+{
+DELETE FROM t1;
+}
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+if (!$skip_truncate)
+{
+TRUNCATE TABLE t1;
+}
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+if (!$skip_delete)
+{
+DELETE FROM t1 WHERE c1 >= 100;
+}
+# InnoDB does reset auto_increment on OPTIMIZE, Bug#18274
+# Archive does reset auto_increment on OPTIMIZE, Bug#40216
+OPTIMIZE TABLE t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+-- echo # Simple test with NULL
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ENGINE=$engine
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+-- echo # Test with sql_mode and first insert as 0
+eval CREATE TABLE t1 (
+ c1 INT,
+ c2 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c2))
+ENGINE=$engine
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (1, NULL);
+let $old_sql_mode = `select @@session.sql_mode`;
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (1, 0);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+SELECT * FROM t1 ORDER BY c1, c2;
+DROP TABLE t1;
+eval CREATE TABLE t1 (
+ c1 INT,
+ c2 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c2))
+ENGINE=$engine
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (1, 0);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+eval SET @@session.sql_mode = '$old_sql_mode';
+DROP TABLE t1;
+
+
+-- echo # Simple test with NULL, 0 and explicit values both incr. and desc.
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ENGINE=$engine
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (5), (16);
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (17), (19), (NULL);
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (NULL), (9);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (59), (55);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+if (!$skip_update)
+{
+ UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+ UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+ FLUSH TABLES;
+ UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+ -- error 0, ER_BAD_NULL_ERROR
+ UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+ INSERT INTO t1 VALUES (NULL);
+ INSERT INTO t1 VALUES (NULL);
+}
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
+-- echo # Test with auto_increment_increment and auto_increment_offset.
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ENGINE=$engine
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+let $old_increment = `SELECT @@session.auto_increment_increment`;
+let $old_offset = `SELECT @@session.auto_increment_offset`;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+let $new_val = `SELECT LAST_INSERT_ID()`;
+eval INSERT INTO t1 VALUES ($new_val + 1);
+INSERT INTO t1 VALUES (NULL);
+let $new_val = `SELECT LAST_INSERT_ID()`;
+eval INSERT INTO t1 VALUES ($new_val + 2);
+INSERT INTO t1 VALUES (NULL);
+let $new_val = `SELECT LAST_INSERT_ID()`;
+eval INSERT INTO t1 VALUES ($new_val + 3);
+INSERT INTO t1 VALUES (NULL);
+let $new_val = `SELECT LAST_INSERT_ID()`;
+eval INSERT INTO t1 VALUES ($new_val + 4);
+INSERT INTO t1 VALUES (NULL);
+let $new_val = `SELECT LAST_INSERT_ID()`;
+eval INSERT INTO t1 VALUES ($new_val + 5);
+INSERT INTO t1 VALUES (NULL);
+let $new_val = `SELECT LAST_INSERT_ID()`;
+eval INSERT INTO t1 VALUES ($new_val + 6);
+INSERT INTO t1 VALUES (NULL);
+eval SET @@session.auto_increment_increment = $old_increment;
+eval SET @@session.auto_increment_offset = $old_offset;
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
+
+-- echo # Test reported auto_increment value
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ENGINE=$engine
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (10);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+SELECT * FROM t1 ORDER BY c1;
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+INSERT INTO t1 VALUES (NULL);
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (15);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+INSERT INTO t1 VALUES (NULL);
+if (!$skip_delete)
+{
+DELETE FROM t1;
+}
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+if (!$skip_truncate)
+{
+TRUNCATE TABLE t1;
+}
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+if (!$skip_delete)
+{
+DELETE FROM t1 WHERE c1 >= 100;
+}
+# InnoDB does reset auto_increment on OPTIMIZE, Bug#18274
+OPTIMIZE TABLE t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+-- echo # Test with two threads
+connection default;
+-- echo # con default
+eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ ENGINE = $engine
+ PARTITION BY HASH(c1)
+ PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+connect(con1, localhost, root,,);
+connection con1;
+-- echo # con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+connection default;
+-- echo # con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+-- echo # con1
+connection con1;
+INSERT INTO t1 (c1) VALUES (NULL);
+connection default;
+-- echo # con default
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 (c1) VALUES (16);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+-- echo # con1
+connection con1;
+INSERT INTO t1 (c1) VALUES (NULL);
+disconnect con1;
+connection default;
+-- echo # con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
+-- echo # Test with two threads + start transaction NO PARTITIONING
+connect(con1, localhost, root,,);
+connection default;
+-- echo # con default
+eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ ENGINE = $engine;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+connection con1;
+-- echo # con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+connection default;
+-- echo # con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+-- echo # con1
+connection con1;
+INSERT INTO t1 (c1) VALUES (NULL);
+connection default;
+-- echo # con default
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 (c1) VALUES (16);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+-- echo # con1
+connection con1;
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+disconnect con1;
+connection default;
+-- echo # con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
+-- echo # Test with two threads + start transaction
+connect(con1, localhost, root,,);
+connection default;
+-- echo # con default
+eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ ENGINE = $engine
+ PARTITION BY HASH(c1)
+ PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+connection con1;
+-- echo # con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+connection default;
+-- echo # con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+-- echo # con1
+connection con1;
+INSERT INTO t1 (c1) VALUES (NULL);
+connection default;
+-- echo # con default
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 (c1) VALUES (16);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+-- echo # con1
+connection con1;
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+disconnect con1;
+connection default;
+-- echo # con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
+if (!$only_ai_pk)
+{
+-- echo # Test with another column after
+eval CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = $engine
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+DROP TABLE t1;
+}
+
+-- echo # Test with another column before
+eval CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = $engine
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+-- error 0, ER_DUP_KEY, ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1, 1);
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+-- error 0, ER_DUP_KEY, ER_DUP_ENTRY
+INSERT INTO t1 VALUES (2, 2);
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+DROP TABLE t1;
+
+-- echo # Test with auto_increment on secondary column in multi-column-index
+-- disable_abort_on_error
+eval CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = $engine
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+-- enable_abort_on_error
+-- disable_query_log
+eval SET @my_errno= $mysql_errno ;
+let $run = `SELECT @my_errno = 0`;
+# ER_WRONG_AUTO_KEY is 1075
+let $ER_WRONG_AUTO_KEY= 1075;
+if (`SELECT @my_errno NOT IN (0,$ER_WRONG_AUTO_KEY)`)
+{
+ -- echo # Unknown error code, exits
+ exit;
+}
+-- enable_query_log
+if ($run)
+{
+INSERT INTO t1 VALUES (1, 0);
+-- error 0, ER_DUP_KEY, ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1, 1);
+if (!$mysql_errno)
+{
+ echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (3, NULL);
+INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 VALUES (2, 2);
+if (!$mysql_errno)
+{
+echo # ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY;
+}
+INSERT INTO t1 VALUES (2, 22), (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+DROP TABLE t1;
+}
+
+-- echo # Test AUTO_INCREMENT in CREATE
+eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ ENGINE = $engine
+ AUTO_INCREMENT = 15
+ PARTITION BY HASH(c1)
+ PARTITIONS 2;
+SHOW CREATE TABLE t1;
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 (c1) VALUES (4);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+
+-- echo # Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+let $old_sql_mode = `select @@session.sql_mode`;
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+-- error 0, ER_DUP_KEY
+INSERT INTO t1 (c1) VALUES (0);
+if ($mysql_errno)
+{
+ echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
+}
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+eval SET @@session.sql_mode = '$old_sql_mode';
+DROP TABLE t1;
+
+-- echo # Test SET INSERT_ID
+eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ ENGINE = $engine
+ PARTITION BY HASH(c1)
+ PARTITIONS 2;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
+-- echo # Testing with FLUSH TABLE
+eval CREATE TABLE t1 (
+ c1 INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (c1))
+ ENGINE=$engine
+ PARTITION BY HASH(c1)
+ PARTITIONS 2;
+SHOW CREATE TABLE t1;
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/parts/inc/partition_directory.inc b/mysql-test/suite/parts/inc/partition_directory.inc
index f63a1952594..2d2703743ca 100644
--- a/mysql-test/suite/parts/inc/partition_directory.inc
+++ b/mysql-test/suite/parts/inc/partition_directory.inc
@@ -170,19 +170,22 @@ DROP TABLE t1;
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
if ($with_partitioning)
{
-let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-$data_directory
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN ($max_row_div4)
-$index_directory
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN ($max_row_div2)
-$data_directory
-$index_directory
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN $MAX_VALUE
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
+# use the new (from bug#14326) partitioning format (i.e. multi-line comments)
+let $partitioning=
+/*!50100 PARTITION BY RANGE(f_int1)
+SUBPARTITION BY KEY(f_int1)
+(PARTITION part1 VALUES LESS THAN (0) $data_directory
+ (SUBPARTITION subpart11,
+ SUBPARTITION subpart12),
+ PARTITION part2 VALUES LESS THAN ($max_row_div4) $index_directory
+ (SUBPARTITION subpart21,
+ SUBPARTITION subpart22),
+ PARTITION part3 VALUES LESS THAN ($max_row_div2) $data_directory $index_directory
+ (SUBPARTITION subpart31,
+ SUBPARTITION subpart32),
+ PARTITION part4 VALUES LESS THAN $MAX_VALUE
+ (SUBPARTITION subpart41,
+ SUBPARTITION subpart42)) */;
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
@@ -198,32 +201,8 @@ DROP TABLE t1;
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
if ($with_partitioning)
{
-let $partitioning=
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- $index_directory
- (SUBPARTITION sp11
- $data_directory,
- SUBPARTITION sp12
- $index_directory),
- PARTITION part2 VALUES IN (1)
- $data_directory
- (SUBPARTITION sp21
- $data_directory,
- SUBPARTITION sp22
- $index_directory),
- PARTITION part3 VALUES IN (2)
- $data_directory
- $index_directory
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- (SUBPARTITION sp41
- $data_directory
- $index_directory,
- SUBPARTITION sp42
- $data_directory
- $index_directory));
+# use the old (pre bug#14326) format (i.e. one line comment)
+let $partitioning= /*!50100 PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) (PARTITION part1 VALUES IN (0) $index_directory (SUBPARTITION sp11 $data_directory, SUBPARTITION sp12 $index_directory), PARTITION part2 VALUES IN (1) $data_directory (SUBPARTITION sp21 $data_directory, SUBPARTITION sp22 $index_directory), PARTITION part3 VALUES IN (2) $data_directory $index_directory (SUBPARTITION sp31, SUBPARTITION sp32), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 $data_directory $index_directory, SUBPARTITION sp42 $data_directory $index_directory)) */;
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
diff --git a/mysql-test/suite/parts/inc/partition_mgm.inc b/mysql-test/suite/parts/inc/partition_mgm.inc
index f36b1a9921f..1ab548222a8 100644
--- a/mysql-test/suite/parts/inc/partition_mgm.inc
+++ b/mysql-test/suite/parts/inc/partition_mgm.inc
@@ -13,7 +13,6 @@
# part_optA-D Extra partitioning options (E.g. INDEX/DATA DIR) #
# #
# have_bug33158 NDB case insensitive create, but case sensitive rename #
-# have_bug37719 Archive, crash when rename and then select #
#------------------------------------------------------------------------------#
# Original Author: mattiasj #
# Original Date: 2008-06-27 #
@@ -125,18 +124,12 @@ PARTITION BY KEY (a)
PARTITION PartD $part_optD);
INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10);
SHOW TABLES;
-if (!$have_bug37719)
-{
RENAME TABLE TableA to tableA;
-}
--sorted_result
SELECT * FROM tablea;
-if (!$have_bug37719)
-{
--sorted_result
SELECT * FROM tableA;
RENAME TABLE tableA to TableA;
-}
SHOW CREATE TABLE tablea;
DROP TABLE tablea;
}
@@ -262,18 +255,12 @@ PARTITION BY HASH (a)
PARTITION PartD $part_optD);
INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10);
SHOW TABLES;
-if (!$have_bug37719)
-{
RENAME TABLE TableA to tableA;
-}
--sorted_result
SELECT * FROM tablea;
-if (!$have_bug37719)
-{
--sorted_result
SELECT * FROM tableA;
RENAME TABLE tableA to TableA;
-}
SHOW CREATE TABLE tablea;
DROP TABLE tablea;
}
@@ -388,18 +375,12 @@ PARTITION BY RANGE (a)
PARTITION PartD VALUES LESS THAN (13) $part_optD);
INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10);
SHOW TABLES;
-if (!$have_bug37719)
-{
RENAME TABLE TableA to tableA;
-}
--sorted_result
SELECT * FROM tablea;
-if (!$have_bug37719)
-{
--sorted_result
SELECT * FROM tableA;
RENAME TABLE tableA to TableA;
-}
SHOW CREATE TABLE tablea;
DROP TABLE tablea;
}
@@ -516,18 +497,12 @@ PARTITION BY LIST (a)
PARTITION PartD VALUES IN (5,6,12) $part_optD);
INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10);
SHOW TABLES;
-if (!$have_bug37719)
-{
RENAME TABLE TableA to tableA;
-}
--sorted_result
SELECT * FROM tablea;
-if (!$have_bug37719)
-{
--sorted_result
SELECT * FROM tableA;
RENAME TABLE tableA to TableA;
-}
SHOW CREATE TABLE tablea;
DROP TABLE tablea;
}
diff --git a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
index c82fe560121..768aa86c832 100644
--- a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
+++ b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
@@ -175,7 +175,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 4 */
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -184,7 +186,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c3)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -193,7 +198,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (c3)
+(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4;
Table Create Table
t4 CREATE TABLE `t4` (
@@ -202,7 +211,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 2 */
SHOW CREATE TABLE test.t5;
Table Create Table
t5 CREATE TABLE `t5` (
@@ -211,7 +222,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (pk1)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6;
Table Create Table
t6 CREATE TABLE `t6` (
@@ -220,7 +234,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (pk1)
+(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
@@ -341,7 +358,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 4 */
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -350,7 +369,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c3)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -359,7 +381,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (c3)
+(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4;
Table Create Table
t4 CREATE TABLE `t4` (
@@ -368,7 +394,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c3)
+PARTITIONS 2 */
SHOW CREATE TABLE test.t5;
Table Create Table
t5 CREATE TABLE `t5` (
@@ -377,7 +405,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (pk1)
+(PARTITION p0 ENGINE = ndbcluster,
+ PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6;
Table Create Table
t6 CREATE TABLE `t6` (
@@ -386,7 +417,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (pk1)
+(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
+ PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
index c47c22ed363..abdcab76d26 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
@@ -615,7 +615,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (abs(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 15
@@ -2291,7 +2300,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (mod(col1,10))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 15
@@ -3620,7 +3638,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (day(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-05
@@ -4116,7 +4143,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofmonth(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-05
@@ -4612,7 +4648,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofweek(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -5120,7 +5165,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofyear(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -5618,7 +5672,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` char(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofyear(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -6116,7 +6179,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (extract(month from col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -6614,7 +6686,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (hour(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 09:09:15
@@ -7118,7 +7199,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (microsecond(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 05:30:34
@@ -7608,7 +7698,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (minute(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 10:24:23
@@ -8118,7 +8217,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (second(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 09:09:15
@@ -8628,7 +8736,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` char(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (second(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 09:09:15.000002
@@ -9138,7 +9255,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (month(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -9642,7 +9768,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (quarter(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -10144,7 +10279,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 10:33:11
@@ -10652,7 +10796,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01'))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-06
@@ -11152,7 +11305,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (datediff(col1, '2006-01-01'))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-06
@@ -11652,7 +11814,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (weekday(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -12152,7 +12323,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (year(col1)-1990)
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -12656,7 +12836,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (yearweek(col1)-200600)
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
index f14f9517646..3a54be8fec2 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
@@ -615,7 +615,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (abs(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 15
@@ -2291,7 +2300,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (mod(col1,10))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 15
@@ -3620,7 +3638,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (day(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-05
@@ -4116,7 +4143,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofmonth(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-05
@@ -4612,7 +4648,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofweek(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -5120,7 +5165,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofyear(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -5618,7 +5672,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` char(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofyear(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -6116,7 +6179,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (extract(month from col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -6614,7 +6686,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (hour(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 09:09:15
@@ -7118,7 +7199,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (microsecond(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 05:30:34
@@ -7608,7 +7698,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (minute(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 10:24:23
@@ -8118,7 +8217,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (second(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 09:09:15
@@ -8628,7 +8736,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` char(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (second(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 09:09:15.000002
@@ -9138,7 +9255,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (month(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -9642,7 +9768,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (quarter(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -10144,7 +10279,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 10:33:11
@@ -10652,7 +10796,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01'))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-06
@@ -11152,7 +11305,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (datediff(col1, '2006-01-01'))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-06
@@ -11652,7 +11814,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (weekday(col1))
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -12152,7 +12323,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (year(col1)-1990)
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -12656,7 +12836,16 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (yearweek(col1)-200600)
+SUBPARTITIONS 5
+(PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM,
+ PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM,
+ PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
index e81b926e092..1bacbc1b325 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
@@ -592,7 +592,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (abs(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 15
@@ -1795,7 +1800,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (mod(col1,10))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 15
@@ -2639,7 +2649,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (day(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-05
@@ -3022,7 +3037,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofmonth(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-05
@@ -3405,7 +3425,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofweek(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -3798,7 +3823,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofyear(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -4181,7 +4211,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` char(30) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (dayofyear(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -4564,7 +4599,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (extract(month from col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -4957,7 +4997,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (hour(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 09:09:15
@@ -5350,7 +5395,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (microsecond(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 05:30:34
@@ -5733,7 +5783,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (minute(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 10:24:23
@@ -6126,7 +6181,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (second(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 09:09:15
@@ -6519,7 +6579,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` char(30) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (second(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 09:09:15.000002
@@ -6912,7 +6977,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (month(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -7305,7 +7375,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (quarter(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -7698,7 +7773,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 10:33:11
@@ -8091,7 +8171,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01'))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-06
@@ -8474,7 +8559,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (datediff(col1, '2006-01-01'))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-06
@@ -8857,7 +8947,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (weekday(col1))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -9250,7 +9345,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (year(col1)-1990)
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -9643,7 +9743,12 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (colint)
+SUBPARTITION BY HASH (yearweek(col1)-200600)
+SUBPARTITIONS 4
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
select * from t55 order by colint;
colint col1
1 2006-02-03
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
index 7d817bd419d..7ab726136af 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
@@ -74,7 +74,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -564,7 +566,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1062,7 +1066,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1558,7 +1571,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2050,7 +2070,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2546,7 +2573,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3042,7 +3083,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3536,7 +3591,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4027,7 +4088,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4517,7 +4580,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5015,7 +5080,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5511,7 +5585,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6003,7 +6084,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6499,7 +6587,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6995,7 +7097,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7489,7 +7605,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7981,7 +8103,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8487,7 +8611,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9001,7 +9127,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9513,7 +9648,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10021,7 +10163,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10533,7 +10682,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11045,7 +11208,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11555,7 +11732,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12062,7 +12245,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12568,7 +12753,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13082,7 +13269,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13594,7 +13790,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14102,7 +14305,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14614,7 +14824,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15126,7 +15350,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15636,7 +15874,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16145,7 +16389,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16636,7 +16882,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17135,7 +17383,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17632,7 +17889,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18125,7 +18389,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18622,7 +18893,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -19119,7 +19404,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -19614,7 +19913,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20106,7 +20411,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20597,7 +20904,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21096,7 +21405,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21593,7 +21911,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22086,7 +22411,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22583,7 +22915,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23080,7 +23426,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23575,7 +23935,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24067,7 +24433,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24558,7 +24926,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25057,7 +25427,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25554,7 +25933,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26047,7 +26433,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26544,7 +26937,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27041,7 +27448,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27536,7 +27957,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
index 07ad5b0e1e9..69f2bfa472e 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
@@ -74,7 +74,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -589,7 +591,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -1118,7 +1122,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#part0.MYD
@@ -1651,7 +1664,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#parta.MYD
@@ -2176,7 +2196,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -2709,7 +2736,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -3242,7 +3283,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -3773,7 +3828,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -4303,7 +4364,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -4818,7 +4881,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -5347,7 +5412,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part0.MYD
@@ -5880,7 +5954,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta.MYD
@@ -6405,7 +6486,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -6938,7 +7026,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -7471,7 +7573,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -8002,7 +8118,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
index 69cd4a26c89..eeb55488d93 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
@@ -392,7 +392,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -882,7 +884,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1380,7 +1384,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1876,7 +1889,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2368,7 +2388,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2866,7 +2893,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3362,7 +3403,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3856,7 +3911,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4347,7 +4408,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4837,7 +4900,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5335,7 +5400,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5831,7 +5905,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6323,7 +6404,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6821,7 +6909,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7317,7 +7419,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7811,7 +7927,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8303,7 +8425,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8809,7 +8933,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9323,7 +9449,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9835,7 +9970,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10343,7 +10485,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10857,7 +11006,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11369,7 +11532,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11879,7 +12056,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12386,7 +12569,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12892,7 +13077,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13406,7 +13593,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13918,7 +14114,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14426,7 +14629,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14940,7 +15150,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15452,7 +15676,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15962,7 +16200,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
index 3565e02e5ae..2137c37c3a2 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result
@@ -233,7 +233,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -748,7 +750,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -1277,7 +1281,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#part0.MYD
@@ -1810,7 +1823,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#parta.MYD
@@ -2335,7 +2355,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -2870,7 +2897,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -3403,7 +3444,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -3934,7 +3989,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -4464,7 +4525,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -4979,7 +5042,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -5508,7 +5573,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part0.MYD
@@ -6041,7 +6115,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta.MYD
@@ -6566,7 +6647,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -7101,7 +7189,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -7634,7 +7736,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -8165,7 +8281,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
index 1d2346b95e3..369882a0427 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
@@ -72,7 +72,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -510,7 +512,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -956,7 +960,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1400,7 +1413,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1840,7 +1860,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2286,7 +2313,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2730,7 +2771,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3172,7 +3227,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3611,7 +3672,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4049,7 +4112,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4495,7 +4560,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4939,7 +5013,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5379,7 +5460,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5825,7 +5913,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6269,7 +6371,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6711,7 +6827,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7150,7 +7272,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7604,7 +7728,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8066,7 +8192,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8526,7 +8661,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8982,7 +9124,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9444,7 +9593,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9904,7 +10067,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10362,7 +10539,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10821,7 +11004,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11259,7 +11444,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11705,7 +11892,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12149,7 +12345,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12589,7 +12792,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13033,7 +13243,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13477,7 +13701,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13919,7 +14157,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14358,7 +14602,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14796,7 +15042,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15242,7 +15490,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15686,7 +15943,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16126,7 +16390,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16570,7 +16841,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17014,7 +17299,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17456,7 +17755,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17896,7 +18201,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18350,7 +18657,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18812,7 +19121,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -19272,7 +19590,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -19728,7 +20053,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20188,7 +20520,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20648,7 +20994,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21106,7 +21466,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21561,7 +21927,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22015,7 +22383,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22477,7 +22847,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22937,7 +23316,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23393,7 +23779,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23853,7 +24246,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24313,7 +24720,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24771,7 +25192,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25227,7 +25654,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25665,7 +26094,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26111,7 +26542,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26555,7 +26995,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26995,7 +27442,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27439,7 +27893,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27883,7 +28351,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -28325,7 +28807,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -28764,7 +29252,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -29202,7 +29692,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -29648,7 +30140,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30092,7 +30593,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30532,7 +31040,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30976,7 +31491,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -31420,7 +31949,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -31862,7 +32405,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -32301,7 +32850,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -32755,7 +33306,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -33217,7 +33770,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -33677,7 +34239,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -34133,7 +34702,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -34593,7 +35169,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35053,7 +35643,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35511,7 +36115,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
index 811ddf5384e..4d91af85003 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result
@@ -71,7 +71,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -534,7 +536,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -1011,7 +1015,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -1492,7 +1505,14 @@ t1 CREATE TABLE `t1` (
`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) (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) */
+) 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
t1#P#parta.MYD
@@ -1965,7 +1985,14 @@ t1 CREATE TABLE `t1` (
`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 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -2448,7 +2475,21 @@ t1 CREATE TABLE `t1` (
`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_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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -2929,7 +2970,21 @@ t1 CREATE TABLE `t1` (
`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_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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -3408,7 +3463,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -3890,7 +3951,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -4353,7 +4416,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -4830,7 +4895,16 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part0.MYD
@@ -5311,7 +5385,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta.MYD
@@ -5784,7 +5865,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -6265,7 +6353,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -6746,7 +6848,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -7225,7 +7341,13 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -7703,7 +7825,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -8166,7 +8290,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -8643,7 +8769,16 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part0.MYD
@@ -9124,7 +9259,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta.MYD
@@ -9597,7 +9739,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -10078,7 +10227,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -10559,7 +10722,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -11038,7 +11215,13 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -11516,7 +11699,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -11979,7 +12164,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -12456,7 +12643,16 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part0.MYD
@@ -12937,7 +13133,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta.MYD
@@ -13410,7 +13613,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -13891,7 +14101,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -14372,7 +14596,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -14851,7 +15089,13 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_innodb.result
new file mode 100644
index 00000000000..17d2c1384e0
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter2_1_innodb.result
@@ -0,0 +1,60196 @@
+SET @max_row = 20;
+SET @@session.storage_engine = 'InnoDB';
+
+#------------------------------------------------------------------------
+# 0. Setting of auxiliary variables + Creation of an auxiliary tables
+# needed in many testcases
+#------------------------------------------------------------------------
+SELECT @max_row DIV 2 INTO @max_row_div2;
+SELECT @max_row DIV 3 INTO @max_row_div3;
+SELECT @max_row DIV 4 INTO @max_row_div4;
+SET @max_int_4 = 2147483647;
+DROP TABLE IF EXISTS t0_template;
+CREATE TABLE t0_template (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) ,
+PRIMARY KEY(f_int1))
+ENGINE = MEMORY;
+# Logging of <max_row> INSERTs into t0_template suppressed
+DROP TABLE IF EXISTS t0_definition;
+CREATE TABLE t0_definition (
+state CHAR(3),
+create_command VARBINARY(5000),
+file_list VARBINARY(10000),
+PRIMARY KEY (state)
+) ENGINE = MEMORY;
+DROP TABLE IF EXISTS t0_aux;
+CREATE TABLE t0_aux ( f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) )
+ENGINE = MEMORY;
+SET AUTOCOMMIT= 1;
+SET @@session.sql_mode= '';
+# End of basic preparations needed for all tests
+#-----------------------------------------------
+
+#========================================================================
+# 1 Increase the size of the column used in the partitioning
+# function and/or PRIMARY KEY and/or UNIQUE INDEX
+#========================================================================
+#------------------------------------------------------------------------
+# 1.1 ALTER column f_int2 not used in partitioning function
+#------------------------------------------------------------------------
+# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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;
+# 1.1.2 PRIMARY KEY exists
+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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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;
+# 1.1.3 UNIQUE INDEX exists
+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_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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;
+#------------------------------------------------------------------------
+# 1.3 ALTER column f_int1 and f_int2
+# f_int1 or (f_int1 and f_int2) used in partitioning function
+#------------------------------------------------------------------------
+# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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;
+# 1.3.2 PRIMARY KEY exists
+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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int1,f_int2)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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)
+, PRIMARY KEY (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) NOT NULL DEFAULT '0',
+ `f_int2` bigint(20) NOT NULL DEFAULT '0',
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+ERROR 23000: Column 'f_int1' cannot be null
+# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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;
+# 1.3.3 UNIQUE INDEX exists
+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 uidx (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int1,f_int2)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+
+# 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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;
+
+# check transactions-6 success: 1
+# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+# 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 VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t0_aux;
+DROP TABLE IF EXISTS t0_definition;
+DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_maria.result b/mysql-test/suite/parts/r/partition_alter2_1_maria.result
new file mode 100644
index 00000000000..d072d18c76b
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter2_1_maria.result
@@ -0,0 +1,37434 @@
+SET @max_row = 20;
+SET @@session.storage_engine = 'MARIA';
+
+#------------------------------------------------------------------------
+# 0. Setting of auxiliary variables + Creation of an auxiliary tables
+# needed in many testcases
+#------------------------------------------------------------------------
+SELECT @max_row DIV 2 INTO @max_row_div2;
+SELECT @max_row DIV 3 INTO @max_row_div3;
+SELECT @max_row DIV 4 INTO @max_row_div4;
+SET @max_int_4 = 2147483647;
+DROP TABLE IF EXISTS t0_template;
+CREATE TABLE t0_template (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) ,
+PRIMARY KEY(f_int1))
+ENGINE = MEMORY;
+# Logging of <max_row> INSERTs into t0_template suppressed
+DROP TABLE IF EXISTS t0_definition;
+CREATE TABLE t0_definition (
+state CHAR(3),
+create_command VARBINARY(5000),
+file_list VARBINARY(10000),
+PRIMARY KEY (state)
+) ENGINE = MEMORY;
+DROP TABLE IF EXISTS t0_aux;
+CREATE TABLE t0_aux ( f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) )
+ENGINE = MEMORY;
+SET AUTOCOMMIT= 1;
+SET @@session.sql_mode= '';
+# End of basic preparations needed for all tests
+#-----------------------------------------------
+
+#========================================================================
+# 1 Increase the size of the column used in the partitioning
+# function and/or PRIMARY KEY and/or UNIQUE INDEX
+#========================================================================
+#------------------------------------------------------------------------
+# 1.1 ALTER column f_int2 not used in partitioning function
+#------------------------------------------------------------------------
+# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 1.1.3 UNIQUE INDEX exists
+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_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+#------------------------------------------------------------------------
+# 1.3 ALTER column f_int1 and f_int2
+# f_int1 or (f_int1 and f_int2) used in partitioning function
+#------------------------------------------------------------------------
+# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 1.3.3 UNIQUE INDEX exists
+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 uidx (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t0_aux;
+DROP TABLE IF EXISTS t0_definition;
+DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
new file mode 100644
index 00000000000..0e0428af48e
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result
@@ -0,0 +1,37434 @@
+SET @max_row = 20;
+SET @@session.storage_engine = 'MyISAM';
+
+#------------------------------------------------------------------------
+# 0. Setting of auxiliary variables + Creation of an auxiliary tables
+# needed in many testcases
+#------------------------------------------------------------------------
+SELECT @max_row DIV 2 INTO @max_row_div2;
+SELECT @max_row DIV 3 INTO @max_row_div3;
+SELECT @max_row DIV 4 INTO @max_row_div4;
+SET @max_int_4 = 2147483647;
+DROP TABLE IF EXISTS t0_template;
+CREATE TABLE t0_template (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) ,
+PRIMARY KEY(f_int1))
+ENGINE = MEMORY;
+# Logging of <max_row> INSERTs into t0_template suppressed
+DROP TABLE IF EXISTS t0_definition;
+CREATE TABLE t0_definition (
+state CHAR(3),
+create_command VARBINARY(5000),
+file_list VARBINARY(10000),
+PRIMARY KEY (state)
+) ENGINE = MEMORY;
+DROP TABLE IF EXISTS t0_aux;
+CREATE TABLE t0_aux ( f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) )
+ENGINE = MEMORY;
+SET AUTOCOMMIT= 1;
+SET @@session.sql_mode= '';
+# End of basic preparations needed for all tests
+#-----------------------------------------------
+
+#========================================================================
+# 1 Increase the size of the column used in the partitioning
+# function and/or PRIMARY KEY and/or UNIQUE INDEX
+#========================================================================
+#------------------------------------------------------------------------
+# 1.1 ALTER column f_int2 not used in partitioning function
+#------------------------------------------------------------------------
+# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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,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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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)
+(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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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_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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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_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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) 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_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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 1.1.3 UNIQUE INDEX exists
+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_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+#------------------------------------------------------------------------
+# 1.3 ALTER column f_int1 and f_int2
+# f_int1 or (f_int1 and f_int2) used in partitioning function
+#------------------------------------------------------------------------
+# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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,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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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)
+(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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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_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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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_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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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_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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 1.3.3 UNIQUE INDEX exists
+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 uidx (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+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` bigint(20) DEFAULT NULL,
+ `f_int2` bigint(20) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t0_aux;
+DROP TABLE IF EXISTS t0_definition;
+DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_2_innodb.result
index e9b1e1c86ef..e2cf04c35b3 100644
--- a/mysql-test/suite/parts/r/partition_alter2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_innodb.result
@@ -1,5 +1,5 @@
SET @max_row = 20;
-SET @@session.storage_engine = 'MyISAM';
+SET @@session.storage_engine = 'InnoDB';
#------------------------------------------------------------------------
# 0. Setting of auxiliary variables + Creation of an auxiliary tables
@@ -39,13 +39,13 @@ SET @@session.sql_mode= '';
#-----------------------------------------------
#========================================================================
-# 1 Increase the size of the column used in the partitioning
+# 2 Decrease the size of the column used in the partitioning
# function and/or PRIMARY KEY and/or UNIQUE INDEX
#========================================================================
#------------------------------------------------------------------------
-# 1.1 ALTER column f_int2 not used in partitioning function
+# 2.1 ALTER column f_int2 not used in partitioning function
#------------------------------------------------------------------------
-# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -59,7 +59,7 @@ PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -69,19 +69,13 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -149,6 +143,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -207,11 +203,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -227,7 +221,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -498,11 +492,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -522,7 +517,7 @@ PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -532,25 +527,13 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -618,6 +601,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -676,11 +661,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -696,7 +679,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -967,11 +950,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -999,7 +983,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -1009,31 +993,20 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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,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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1101,6 +1074,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -1159,11 +1134,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -1179,7 +1152,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -1450,11 +1423,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -1480,7 +1454,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -1490,27 +1464,18 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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) (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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1634,11 +1599,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -1654,7 +1617,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -1925,11 +1888,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -1953,7 +1917,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -1963,31 +1927,18 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2055,6 +2006,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -2113,11 +2066,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -2133,7 +2084,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -2404,11 +2355,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -2436,7 +2388,7 @@ PARTITION part4 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -2446,31 +2398,25 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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_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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2594,11 +2540,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -2614,7 +2558,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -2885,11 +2829,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -2917,7 +2862,7 @@ PARTITION part4 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -2927,31 +2872,25 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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_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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3019,6 +2958,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -3077,11 +3018,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -3097,7 +3036,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -3368,11 +3307,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -3396,7 +3336,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -3406,33 +3346,17 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int2` mediumint(9) 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_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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3500,6 +3424,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -3558,11 +3484,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -3578,7 +3502,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -3849,11 +3773,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -3861,7 +3786,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
-# 1.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -3869,13 +3793,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -3884,21 +3808,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3983,6 +3901,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -3994,24 +3914,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -4075,11 +3979,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -4095,7 +3997,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -4366,11 +4268,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -4384,13 +4287,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -4399,27 +4302,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4504,6 +4395,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -4515,24 +4408,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -4596,11 +4473,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -4616,7 +4491,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -4887,11 +4762,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -4905,7 +4781,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
@@ -4919,7 +4795,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -4928,33 +4804,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5039,6 +4904,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -5050,24 +4917,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -5131,11 +4982,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -5151,7 +5000,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -5422,11 +5271,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -5440,7 +5290,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
@@ -5452,7 +5302,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -5461,29 +5311,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5577,24 +5418,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -5658,11 +5483,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -5678,7 +5501,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -5949,11 +5772,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -5967,7 +5791,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -5977,7 +5801,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -5986,33 +5810,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6097,6 +5908,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -6108,24 +5921,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -6189,11 +5986,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -6209,7 +6004,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -6480,11 +6275,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -6498,7 +6294,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
@@ -6512,7 +6308,7 @@ PARTITION part4 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -6521,33 +6317,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6641,24 +6431,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -6722,11 +6496,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -6742,7 +6514,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -7013,11 +6785,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -7031,7 +6804,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -7045,7 +6818,7 @@ PARTITION part4 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -7054,33 +6827,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7165,6 +6932,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -7176,24 +6945,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -7257,11 +7010,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -7277,7 +7028,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -7548,11 +7299,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -7566,7 +7318,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
@@ -7576,7 +7328,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -7585,35 +7337,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7698,6 +7434,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -7709,24 +7447,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -7790,11 +7512,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -7810,7 +7530,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -8081,11 +7801,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -8100,13 +7821,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -8115,21 +7836,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8214,6 +7929,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -8225,24 +7942,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -8306,11 +8007,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -8326,7 +8025,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -8597,11 +8296,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -8615,13 +8315,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -8630,27 +8330,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8735,6 +8423,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -8746,24 +8436,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -8827,11 +8501,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -8847,7 +8519,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -9118,11 +8790,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -9136,7 +8809,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
@@ -9150,7 +8823,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -9159,33 +8832,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9270,6 +8932,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -9281,24 +8945,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -9362,11 +9010,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -9382,7 +9028,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -9653,11 +9299,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -9671,7 +9318,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
@@ -9683,7 +9330,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -9692,29 +9339,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9808,24 +9446,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -9889,11 +9511,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -9909,7 +9529,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -10180,11 +9800,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -10198,7 +9819,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -10208,7 +9829,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -10217,33 +9838,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10328,6 +9936,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -10339,24 +9949,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -10420,11 +10014,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -10440,7 +10032,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -10711,11 +10303,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -10729,7 +10322,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
@@ -10743,7 +10336,7 @@ PARTITION part4 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -10752,33 +10345,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10872,24 +10459,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -10953,11 +10524,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -10973,7 +10542,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -11244,11 +10813,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -11262,7 +10832,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -11276,7 +10846,7 @@ PARTITION part4 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -11285,33 +10855,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11396,6 +10960,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -11407,24 +10973,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -11488,11 +11038,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -11508,7 +11056,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -11779,11 +11327,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -11797,7 +11346,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
@@ -11807,7 +11356,7 @@ 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 MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -11816,35 +11365,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11929,6 +11462,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -11940,24 +11475,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -12021,949 +11540,9 @@ 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 1.3 ALTER column f_int1 and f_int2
-# f_int1 or (f_int1 and f_int2) used in partitioning function
-#------------------------------------------------------------------------
-# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
-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)
-
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -12979,7 +11558,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -13250,11 +11829,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -13262,6702 +11842,7 @@ TRUNCATE t1;
# 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)
-
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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,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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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) (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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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_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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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_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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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_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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 1.3.3 UNIQUE INDEX exists
+# 2.1.3 UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -19965,13 +11850,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -19980,21 +11865,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20079,6 +11958,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -20171,11 +12052,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -20191,7 +12070,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -20462,11 +12341,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -20480,13 +12360,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -20495,27 +12375,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20600,6 +12468,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -20692,11 +12562,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -20712,7 +12580,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -20983,11 +12851,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -21001,7 +12870,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
@@ -21015,7 +12884,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -21024,33 +12893,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21135,6 +12993,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -21227,11 +13087,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -21247,7 +13105,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -21518,11 +13376,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -21536,7 +13395,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
@@ -21548,7 +13407,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -21557,29 +13416,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21754,11 +13604,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -21774,7 +13622,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -22045,11 +13893,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -22063,7 +13912,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -22073,7 +13922,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -22082,33 +13931,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22193,6 +14029,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -22285,11 +14123,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -22305,7 +14141,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -22576,11 +14412,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -22594,7 +14431,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
@@ -22608,7 +14445,7 @@ PARTITION part4 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -22617,33 +14454,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22818,11 +14649,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -22838,7 +14667,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -23109,11 +14938,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -23127,7 +14957,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -23141,7 +14971,7 @@ PARTITION part4 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -23150,33 +14980,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23261,6 +15085,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -23353,11 +15179,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -23373,7 +15197,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -23644,11 +15468,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -23662,7 +15487,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int1,f_int2)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
@@ -23672,3705 +15497,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (f_int1,f_int2)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -27379,33 +15506,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27490,539 +15603,8 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -28115,11 +15697,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -28135,7 +15715,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -28406,11 +15986,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -28425,13 +16006,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -28440,21 +16021,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -28539,6 +16114,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -28631,11 +16208,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -28651,7 +16226,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -28922,11 +16497,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -28940,13 +16516,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -28955,27 +16531,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -29060,6 +16624,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -29152,11 +16718,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -29172,7 +16736,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -29443,11 +17007,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -29461,7 +17026,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
@@ -29475,7 +17040,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -29484,33 +17049,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -29595,6 +17149,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -29687,11 +17243,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -29707,7 +17261,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -29978,11 +17532,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -29996,7 +17551,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
@@ -30008,7 +17563,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -30017,29 +17572,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30214,11 +17760,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -30234,7 +17778,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -30505,11 +18049,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -30523,7 +18068,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -30533,7 +18078,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -30542,33 +18087,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30653,6 +18185,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -30745,11 +18279,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -30765,7 +18297,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -31036,11 +18568,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -31054,7 +18587,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
@@ -31068,7 +18601,7 @@ PARTITION part4 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -31077,33 +18610,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -31278,11 +18805,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -31298,7 +18823,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -31569,11 +19094,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -31587,7 +19113,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -31601,7 +19127,7 @@ PARTITION part4 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -31610,33 +19136,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -31721,6 +19241,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -31813,11 +19335,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -31833,7 +19353,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -32104,11 +19624,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -32122,7 +19643,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
@@ -32132,7 +19653,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int2 MEDIUMINT;
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;
@@ -32141,35 +19662,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` int(11) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -32254,6 +19759,8 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -32346,11 +19853,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -32366,7 +19871,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -32637,11 +20142,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -32649,6 +20155,10 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
+#------------------------------------------------------------------------
+# 2.3 ALTER column f_int1 and f_int2 used in partitioning function
+#------------------------------------------------------------------------
+# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -32656,13 +20166,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -32671,21 +20181,14 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -32695,19 +20198,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -32729,13 +20222,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -32770,6 +20256,9 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -32803,40 +20292,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -32862,11 +20317,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -32882,7 +20335,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -33153,11 +20606,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -33171,13 +20625,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5;
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -33186,27 +20640,14 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -33216,19 +20657,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -33250,13 +20681,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -33291,6 +20715,9 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -33324,40 +20751,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -33383,11 +20776,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -33403,7 +20794,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -33674,11 +21065,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -33692,9 +21084,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY LIST(MOD(f_int1 + f_int2,4))
+PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
PARTITION part_2 VALUES IN (-2),
PARTITION part_1 VALUES IN (-1),
@@ -33706,7 +21098,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -33715,33 +21107,21 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -33751,19 +21131,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -33785,13 +21155,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -33826,6 +21189,9 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -33859,40 +21225,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -33918,11 +21250,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -33938,7 +21268,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -34209,11 +21539,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -34227,9 +21558,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
+PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN (5),
PARTITION partc VALUES LESS THAN (10),
@@ -34239,7 +21570,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -34248,29 +21579,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -34280,19 +21601,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -34314,13 +21625,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -34355,7 +21659,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -34386,40 +21695,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -34445,11 +21720,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -34465,7 +21738,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -34736,11 +22009,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -34754,9 +22028,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN (5),
PARTITION partc VALUES LESS THAN (10),
@@ -34764,7 +22038,7 @@ 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -34773,33 +22047,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -34809,19 +22069,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -34843,13 +22093,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -34884,7 +22127,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -34915,40 +22163,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -34974,11 +22188,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -34994,7 +22206,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -35265,11 +22477,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -35283,9 +22496,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN (5)
@@ -35297,7 +22510,7 @@ PARTITION part4 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -35306,33 +22519,26 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35342,19 +22548,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -35376,13 +22572,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -35417,7 +22606,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -35448,40 +22642,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -35507,11 +22667,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -35527,7 +22685,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -35798,11 +22956,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -35816,9 +22975,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
(SUBPARTITION sp11, SUBPARTITION sp12),
PARTITION part2 VALUES IN (1)
@@ -35830,7 +22989,7 @@ PARTITION part4 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -35839,33 +22998,26 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35875,19 +23027,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -35909,13 +23051,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -35950,6 +23085,9 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -35983,40 +23121,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -36042,11 +23146,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -36062,7 +23164,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -36333,11 +23435,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -36351,17 +23454,17 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx (f_int2,f_int1)
+
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
+SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
- PARTITION part2 VALUES IN (1),
- PARTITION part3 VALUES IN (NULL));
+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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -36370,35 +23473,18 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -36408,19 +23494,9 @@ 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
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
@@ -36442,13 +23518,6 @@ 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -36483,6 +23552,9 @@ 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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
DELETE FROM t1 WHERE f_charbig = '#2147483647##';
@@ -36516,40 +23588,6 @@ 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -36575,11 +23613,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -36595,7 +23631,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -36866,11 +23902,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -36878,15 +23915,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
-
-#========================================================================
-# 2 Decrease the size of the column used in the partitioning
-# function and/or PRIMARY KEY and/or UNIQUE INDEX
-#========================================================================
-#------------------------------------------------------------------------
-# 2.1 ALTER column f_int2 not used in partitioning function
-#------------------------------------------------------------------------
-# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -36896,11 +23924,11 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
+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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -36909,20 +23937,14 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -36991,6 +24013,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -37050,11 +24073,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -37070,7 +24091,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -37341,11 +24362,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -37361,11 +24383,11 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY KEY(f_int1) PARTITIONS 5;
+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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -37374,26 +24396,14 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -37462,6 +24472,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -37521,11 +24532,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -37541,7 +24550,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -37812,11 +24821,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -37832,7 +24842,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY LIST(MOD(f_int1,4))
+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),
@@ -37844,7 +24854,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -37853,32 +24863,21 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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,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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -37947,6 +24946,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -38006,11 +25006,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -38026,7 +25024,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -38297,11 +25295,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -38317,7 +25316,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY RANGE(f_int1)
+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),
@@ -38327,7 +25326,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -38336,28 +25335,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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) (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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -38425,7 +25415,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -38481,11 +25476,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -38501,7 +25494,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -38772,11 +25765,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -38792,7 +25786,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
+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),
@@ -38800,7 +25794,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -38809,32 +25803,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -38903,6 +25884,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -38962,11 +25944,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -38982,7 +25962,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -39253,11 +26233,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -39273,7 +26254,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+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)
@@ -39285,7 +26266,7 @@ PARTITION part4 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -39294,32 +26275,26 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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_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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -39387,7 +26362,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -39443,11 +26423,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -39463,7 +26441,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -39734,11 +26712,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -39754,7 +26733,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
+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)
@@ -39766,7 +26745,7 @@ PARTITION part4 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -39775,32 +26754,26 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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_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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -39869,6 +26842,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -39928,11 +26902,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -39948,7 +26920,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -40219,11 +27191,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -40240,14 +27213,14 @@ f_charbig VARCHAR(1000)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
+SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
-PARTITION part2 VALUES IN (1),
-PARTITION part3 VALUES IN (NULL));
+ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -40256,34 +27229,18 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
+ `f_int1` mediumint(9) DEFAULT NULL,
`f_int2` mediumint(9) 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_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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -40352,6 +27309,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -40411,11 +27369,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -40431,7 +27387,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -40702,11 +27658,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -40714,7 +27671,7 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
-# 2.1.3 UNIQUE INDEX exists
+# 2.3.2 PRIMARY KEY exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -40722,13 +27679,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -40737,21 +27694,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -40837,6 +27788,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -40849,24 +27801,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -40930,11 +27866,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -40950,7 +27884,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -41221,11 +28155,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -41239,13 +28174,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -41254,27 +28189,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -41360,6 +28283,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -41372,24 +28296,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -41453,11 +28361,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -41473,7 +28379,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -41744,11 +28650,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -41762,7 +28669,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
@@ -41776,7 +28683,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -41785,33 +28692,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -41897,6 +28793,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -41909,24 +28806,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -41990,11 +28871,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -42010,7 +28889,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -42281,11 +29160,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -42299,7 +29179,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
@@ -42311,7 +29191,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -42320,29 +29200,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -42427,7 +29298,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -42436,24 +29312,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -42517,11 +29377,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -42537,7 +29395,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -42808,11 +29666,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -42826,7 +29685,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -42836,7 +29695,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -42845,33 +29704,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -42957,6 +29803,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -42969,24 +29816,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -43050,11 +29881,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -43070,7 +29899,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -43341,11 +30170,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -43359,7 +30189,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
@@ -43373,7 +30203,7 @@ PARTITION part4 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -43382,33 +30212,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -43493,7 +30317,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -43502,24 +30331,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -43583,11 +30396,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -43603,7 +30414,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -43874,11 +30685,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -43892,7 +30704,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -43906,7 +30718,7 @@ PARTITION part4 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -43915,33 +30727,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -44027,6 +30833,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -44039,24 +30846,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -44120,11 +30911,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -44140,7 +30929,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -44411,11 +31200,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -44429,7 +31219,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
@@ -44439,7 +31229,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -44448,35 +31238,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -44562,6 +31336,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -44574,24 +31349,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -44655,11 +31414,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -44675,7 +31432,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -44946,11 +31703,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -44965,13 +31723,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
+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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -44980,21 +31738,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -45080,6 +31832,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -45092,24 +31845,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -45173,11 +31910,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -45193,7 +31928,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -45464,11 +32199,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -45482,13 +32218,13 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY KEY(f_int1) PARTITIONS 5;
+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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -45497,27 +32233,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -45603,6 +32327,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -45615,24 +32340,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -45696,11 +32405,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -45716,7 +32423,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -45987,11 +32694,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -46005,9 +32713,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY LIST(MOD(f_int1,4))
+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),
@@ -46019,7 +32727,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -46028,33 +32736,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -46140,6 +32837,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -46152,24 +32850,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -46233,11 +32915,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -46253,7 +32933,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -46524,11 +33204,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -46542,9 +33223,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY RANGE(f_int1)
+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),
@@ -46554,7 +33235,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -46563,29 +33244,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -46670,7 +33342,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -46679,24 +33356,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -46760,11 +33421,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -46780,7 +33439,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -47051,11 +33710,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -47069,9 +33729,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
+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),
@@ -47079,7 +33739,7 @@ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -47088,33 +33748,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -47200,6 +33847,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -47212,24 +33860,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -47293,11 +33925,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -47313,7 +33943,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -47584,11 +34214,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -47602,9 +34233,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+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)
@@ -47616,7 +34247,7 @@ PARTITION part4 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -47625,33 +34256,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -47736,7 +34361,12 @@ 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
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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),
@@ -47745,24 +34375,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -47826,11 +34440,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -47846,7 +34458,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -48117,11 +34729,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -48135,9 +34748,9 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
+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)
@@ -48149,7 +34762,7 @@ PARTITION part4 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -48158,33 +34771,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -48270,6 +34877,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -48282,24 +34890,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -48363,11 +34955,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -48383,7 +34973,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -48654,11 +35244,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -48672,17 +35263,17 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
+, PRIMARY KEY (f_int1,f_int2)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
+SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
-PARTITION part2 VALUES IN (1),
-PARTITION part3 VALUES IN (NULL));
+ 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 MODIFY f_int2 MEDIUMINT;
+ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
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;
@@ -48691,35 +35282,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ PRIMARY KEY (`f_int1`,`f_int2`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -48805,6 +35380,7 @@ 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##';
Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
Warning 1264 Out of range value for column 'f_int2' at row 1
# check single-7 success: 1
@@ -48817,24 +35393,8 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be 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)
@@ -48898,11 +35458,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -48918,7 +35476,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -49189,11 +35747,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -49201,10 +35760,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (inc/partition_check.inc)
DROP TABLE t1;
-#------------------------------------------------------------------------
-# 2.3 ALTER column f_int1 and f_int2 used in partitioning function
-#------------------------------------------------------------------------
-# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -49212,7 +35767,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
@@ -49227,20 +35782,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -49250,9 +35800,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -49274,6 +35834,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -49322,28 +35889,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -49369,11 +35954,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -49389,7 +35972,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -49660,11 +36243,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -49678,7 +36262,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY KEY(f_int1) PARTITIONS 5;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
@@ -49693,26 +36277,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -49722,9 +36295,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -49746,6 +36329,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -49794,28 +36384,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -49841,11 +36449,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -49861,7 +36467,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -50132,11 +36738,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -50150,7 +36757,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3),
@@ -50173,32 +36780,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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,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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -50208,9 +36805,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -50232,6 +36839,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -50280,28 +36894,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -50327,11 +36959,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -50347,7 +36977,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -50618,11 +37248,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -50636,7 +37267,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
@@ -50657,28 +37288,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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) (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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -50688,9 +37311,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -50712,6 +37345,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -50760,28 +37400,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -50807,11 +37465,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -50827,7 +37483,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -51098,11 +37754,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -51116,7 +37773,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -51135,32 +37792,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -51170,9 +37815,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -51194,6 +37849,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -51242,28 +37904,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -51289,11 +37969,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -51309,7 +37987,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -51580,11 +38258,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -51598,7 +38277,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
@@ -51621,32 +38300,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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_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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -51656,9 +38330,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -51680,6 +38364,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -51728,28 +38419,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -51775,11 +38484,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -51795,7 +38502,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -52066,11 +38773,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -52084,7 +38792,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -52107,32 +38815,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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_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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -52142,9 +38845,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -52166,6 +38879,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -52214,28 +38934,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -52261,11 +38999,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -52281,7 +39017,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -52552,11 +39288,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -52570,7 +39307,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
@@ -52589,34 +39326,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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_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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -52626,9 +39348,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -52650,6 +39382,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -52698,28 +39437,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -52745,11 +39502,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -52765,7 +39520,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -53036,11 +39791,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -53055,7 +39811,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (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)
@@ -53070,20 +39826,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -53093,9 +39844,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -53117,6 +39878,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -53165,28 +39933,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -53212,11 +39998,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -53232,7 +40016,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -53503,11 +40287,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -53521,7 +40306,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
@@ -53536,26 +40321,15 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -53565,9 +40339,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -53589,6 +40373,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -53637,28 +40428,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -53684,11 +40493,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -53704,7 +40511,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -53975,11 +40782,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -53993,7 +40801,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(MOD(f_int1 + f_int2,4))
(PARTITION part_3 VALUES IN (-3),
@@ -54016,32 +40824,22 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -54051,9 +40849,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -54075,6 +40883,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -54123,28 +40938,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -54170,11 +41003,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -54190,7 +41021,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -54461,11 +41292,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -54479,7 +41311,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
(PARTITION parta VALUES LESS THAN (0),
@@ -54500,28 +41332,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -54531,9 +41355,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -54555,6 +41389,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -54603,28 +41444,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -54650,11 +41509,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -54670,7 +41527,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -54941,11 +41798,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -54959,7 +41817,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
@@ -54978,32 +41836,20 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -55013,9 +41859,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -55037,6 +41893,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -55085,28 +41948,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -55132,11 +42013,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -55152,7 +42031,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -55423,11 +42302,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -55441,7 +42321,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
(PARTITION part1 VALUES LESS THAN (0)
@@ -55464,32 +42344,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -55499,9 +42374,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -55523,6 +42408,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -55571,28 +42463,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -55618,11 +42528,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -55638,7 +42546,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -55909,11 +42817,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -55927,7 +42836,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1)
(PARTITION part1 VALUES IN (0)
@@ -55950,32 +42859,27 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -55985,9 +42889,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -56009,6 +42923,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -56057,28 +42978,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -56104,11 +43043,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -56124,7 +43061,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -56395,11 +43332,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -56413,7 +43351,7 @@ f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000)
-
+, PRIMARY KEY (f_int2,f_int1)
)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
@@ -56432,34 +43370,19 @@ create_command
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f_int1` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
+ `f_int1` mediumint(9) NOT NULL DEFAULT '0',
+ `f_int2` mediumint(9) NOT NULL DEFAULT '0',
`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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ PRIMARY KEY (`f_int2`,`f_int1`)
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -56469,9 +43392,19 @@ 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);
+ERROR 23000: Can't write; duplicate key in table 't1'
# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
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
@@ -56493,6 +43426,13 @@ 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
INSERT INTO t1
SET f_int1 = @cur_value , f_int2 = @cur_value,
@@ -56541,28 +43481,46 @@ 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#';
+ERROR 23000: Column 'f_int1' cannot be null
# check null 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
-# 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 unique-1-a success: 1
-# 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 unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-# check null-3 success: 1
+# check replace 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
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
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#';
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
SET AUTOCOMMIT= 0;
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, '', '', 'was inserted'
@@ -56588,11 +43546,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -56608,7 +43564,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -56879,11 +43835,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -56920,15 +43877,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -57108,11 +44059,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -57128,7 +44077,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -57399,11 +44348,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -57438,21 +44388,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -57632,11 +44570,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -57652,7 +44588,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -57923,11 +44859,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -57970,27 +44907,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -58170,11 +45096,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -58190,7 +45114,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -58461,11 +45385,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -58506,23 +45431,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -58702,11 +45618,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -58722,7 +45636,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -58993,11 +45907,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -59036,27 +45951,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -59236,11 +46138,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -59256,7 +46156,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -59527,11 +46427,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -59574,27 +46475,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -59774,11 +46669,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -59794,7 +46687,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -60065,11 +46958,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -60112,27 +47006,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -60312,11 +47200,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -60332,7 +47218,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -60603,11 +47489,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -60646,29 +47533,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -60848,11 +47719,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -60868,7 +47737,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -61139,11 +48008,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -61179,15 +48049,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -61367,11 +48231,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -61387,7 +48249,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -61658,11 +48520,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -61697,21 +48560,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -61891,11 +48742,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -61911,7 +48760,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -62182,11 +49031,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -62229,27 +49079,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -62429,11 +49268,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -62449,7 +49286,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -62720,11 +49557,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -62765,23 +49603,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -62961,11 +49790,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -62981,7 +49808,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -63252,11 +50079,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -63295,27 +50123,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -63495,11 +50310,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -63515,7 +50328,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -63786,11 +50599,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -63833,27 +50647,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -64033,11 +50841,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -64053,7 +50859,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -64324,11 +51130,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -64371,27 +51178,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -64571,11 +51372,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -64591,7 +51390,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -64862,11 +51661,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -64905,29 +51705,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -65107,11 +51891,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -65127,7 +51909,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -65398,11 +52180,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -65438,15 +52221,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -65626,11 +52403,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -65646,7 +52421,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -65917,11 +52692,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -65956,21 +52732,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -66150,11 +52914,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -66170,7 +52932,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -66441,11 +53203,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -66488,27 +53251,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -66688,11 +53440,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -66708,7 +53458,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -66979,11 +53729,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -67024,23 +53775,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -67220,11 +53962,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -67240,7 +53980,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -67511,11 +54251,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -67554,27 +54295,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -67754,11 +54482,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -67774,7 +54500,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -68045,11 +54771,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -68092,27 +54819,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -68292,11 +55013,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -68312,7 +55031,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -68583,11 +55302,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -68630,27 +55350,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -68830,11 +55544,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -68850,7 +55562,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -69121,11 +55833,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -69164,29 +55877,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -69366,11 +56063,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -69386,7 +56081,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -69657,11 +56352,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -69697,15 +56393,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -69885,11 +56575,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -69905,7 +56593,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -70176,11 +56864,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -70215,21 +56904,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-unified filelist
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1#P#p3.MYD
-t1#P#p3.MYI
-t1#P#p4.MYD
-t1#P#p4.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -70409,11 +57086,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -70429,7 +57104,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -70700,11 +57375,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -70747,27 +57423,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part0.MYD
-t1#P#part0.MYI
-t1#P#part1.MYD
-t1#P#part1.MYI
-t1#P#part2.MYD
-t1#P#part2.MYI
-t1#P#part3.MYD
-t1#P#part3.MYI
-t1#P#part_1.MYD
-t1#P#part_1.MYI
-t1#P#part_2.MYD
-t1#P#part_2.MYI
-t1#P#part_3.MYD
-t1#P#part_3.MYI
-t1#P#part_N.MYD
-t1#P#part_N.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -70947,11 +57612,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -70967,7 +57630,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -71238,11 +57901,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -71283,23 +57947,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta.MYD
-t1#P#parta.MYI
-t1#P#partb.MYD
-t1#P#partb.MYI
-t1#P#partc.MYD
-t1#P#partc.MYI
-t1#P#partd.MYD
-t1#P#partd.MYI
-t1#P#parte.MYD
-t1#P#parte.MYI
-t1#P#partf.MYD
-t1#P#partf.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -71479,11 +58134,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -71499,7 +58152,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -71770,11 +58423,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -71813,27 +58467,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#parta#SP#partasp0.MYD
-t1#P#parta#SP#partasp0.MYI
-t1#P#parta#SP#partasp1.MYD
-t1#P#parta#SP#partasp1.MYI
-t1#P#partb#SP#partbsp0.MYD
-t1#P#partb#SP#partbsp0.MYI
-t1#P#partb#SP#partbsp1.MYD
-t1#P#partb#SP#partbsp1.MYI
-t1#P#partc#SP#partcsp0.MYD
-t1#P#partc#SP#partcsp0.MYI
-t1#P#partc#SP#partcsp1.MYD
-t1#P#partc#SP#partcsp1.MYI
-t1#P#partd#SP#partdsp0.MYD
-t1#P#partd#SP#partdsp0.MYI
-t1#P#partd#SP#partdsp1.MYD
-t1#P#partd#SP#partdsp1.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -72013,11 +58654,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -72033,7 +58672,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -72304,11 +58943,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -72351,27 +58991,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#subpart11.MYD
-t1#P#part1#SP#subpart11.MYI
-t1#P#part1#SP#subpart12.MYD
-t1#P#part1#SP#subpart12.MYI
-t1#P#part2#SP#subpart21.MYD
-t1#P#part2#SP#subpart21.MYI
-t1#P#part2#SP#subpart22.MYD
-t1#P#part2#SP#subpart22.MYI
-t1#P#part3#SP#subpart31.MYD
-t1#P#part3#SP#subpart31.MYI
-t1#P#part3#SP#subpart32.MYD
-t1#P#part3#SP#subpart32.MYI
-t1#P#part4#SP#subpart41.MYD
-t1#P#part4#SP#subpart41.MYI
-t1#P#part4#SP#subpart42.MYD
-t1#P#part4#SP#subpart42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -72551,11 +59185,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -72571,7 +59203,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -72842,11 +59474,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -72889,27 +59522,21 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#sp11.MYD
-t1#P#part1#SP#sp11.MYI
-t1#P#part1#SP#sp12.MYD
-t1#P#part1#SP#sp12.MYI
-t1#P#part2#SP#sp21.MYD
-t1#P#part2#SP#sp21.MYI
-t1#P#part2#SP#sp22.MYD
-t1#P#part2#SP#sp22.MYI
-t1#P#part3#SP#sp31.MYD
-t1#P#part3#SP#sp31.MYI
-t1#P#part3#SP#sp32.MYD
-t1#P#part3#SP#sp32.MYI
-t1#P#part4#SP#sp41.MYD
-t1#P#part4#SP#sp41.MYI
-t1#P#part4#SP#sp42.MYD
-t1#P#part4#SP#sp42.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -73089,11 +59716,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -73109,7 +59734,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -73380,11 +60005,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@@ -73423,29 +60049,13 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) 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
-t1#P#part1#SP#part1sp0.MYD
-t1#P#part1#SP#part1sp0.MYI
-t1#P#part1#SP#part1sp1.MYD
-t1#P#part1#SP#part1sp1.MYI
-t1#P#part1#SP#part1sp2.MYD
-t1#P#part1#SP#part1sp2.MYI
-t1#P#part2#SP#part2sp0.MYD
-t1#P#part2#SP#part2sp0.MYI
-t1#P#part2#SP#part2sp1.MYD
-t1#P#part2#SP#part2sp1.MYI
-t1#P#part2#SP#part2sp2.MYD
-t1#P#part2#SP#part2sp2.MYI
-t1#P#part3#SP#part3sp0.MYD
-t1#P#part3#SP#part3sp0.MYI
-t1#P#part3#SP#part3sp1.MYD
-t1#P#part3#SP#part3sp1.MYI
-t1#P#part3#SP#part3sp2.MYD
-t1#P#part3#SP#part3sp2.MYI
-t1.frm
-t1.par
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -73625,11 +60235,9 @@ 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.
+# INFO: Storage engine used for t1 seems to be transactional.
COMMIT;
# check transactions-7 success: 1
@@ -73645,7 +60253,7 @@ ERROR 22012: Division by 0
COMMIT;
# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
+# INFO: Storage engine used for t1 seems to be able to revert
# changes made by the failing statement.
SET @@session.sql_mode = '';
SET AUTOCOMMIT= 1;
@@ -73916,11 +60524,12 @@ Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_maria.result b/mysql-test/suite/parts/r/partition_alter2_2_maria.result
new file mode 100644
index 00000000000..f3173ac5ee2
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter2_2_maria.result
@@ -0,0 +1,37643 @@
+SET @max_row = 20;
+SET @@session.storage_engine = 'MARIA';
+
+#------------------------------------------------------------------------
+# 0. Setting of auxiliary variables + Creation of an auxiliary tables
+# needed in many testcases
+#------------------------------------------------------------------------
+SELECT @max_row DIV 2 INTO @max_row_div2;
+SELECT @max_row DIV 3 INTO @max_row_div3;
+SELECT @max_row DIV 4 INTO @max_row_div4;
+SET @max_int_4 = 2147483647;
+DROP TABLE IF EXISTS t0_template;
+CREATE TABLE t0_template (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) ,
+PRIMARY KEY(f_int1))
+ENGINE = MEMORY;
+# Logging of <max_row> INSERTs into t0_template suppressed
+DROP TABLE IF EXISTS t0_definition;
+CREATE TABLE t0_definition (
+state CHAR(3),
+create_command VARBINARY(5000),
+file_list VARBINARY(10000),
+PRIMARY KEY (state)
+) ENGINE = MEMORY;
+DROP TABLE IF EXISTS t0_aux;
+CREATE TABLE t0_aux ( f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) )
+ENGINE = MEMORY;
+SET AUTOCOMMIT= 1;
+SET @@session.sql_mode= '';
+# End of basic preparations needed for all tests
+#-----------------------------------------------
+
+#========================================================================
+# 2 Decrease the size of the column used in the partitioning
+# function and/or PRIMARY KEY and/or UNIQUE INDEX
+#========================================================================
+#------------------------------------------------------------------------
+# 2.1 ALTER column f_int2 not used in partitioning function
+#------------------------------------------------------------------------
+# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 2.1.3 UNIQUE INDEX exists
+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_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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,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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1 + 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+#------------------------------------------------------------------------
+# 2.3 ALTER column f_int1 and f_int2 used in partitioning function
+#------------------------------------------------------------------------
+# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 2.3.3 UNIQUE INDEX exists
+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 uidx (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MAD
+t1#P#p0.MAI
+t1#P#p1.MAD
+t1#P#p1.MAI
+t1#P#p2.MAD
+t1#P#p2.MAI
+t1#P#p3.MAD
+t1#P#p3.MAI
+t1#P#p4.MAD
+t1#P#p4.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = MARIA,
+ PARTITION part_2 VALUES IN (-2) ENGINE = MARIA,
+ PARTITION part_1 VALUES IN (-1) ENGINE = MARIA,
+ PARTITION part_N VALUES IN (NULL) ENGINE = MARIA,
+ PARTITION part0 VALUES IN (0) ENGINE = MARIA,
+ PARTITION part1 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part2 VALUES IN (2) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (3) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part0.MAD
+t1#P#part0.MAI
+t1#P#part1.MAD
+t1#P#part1.MAI
+t1#P#part2.MAD
+t1#P#part2.MAI
+t1#P#part3.MAD
+t1#P#part3.MAI
+t1#P#part_1.MAD
+t1#P#part_1.MAI
+t1#P#part_2.MAD
+t1#P#part_2.MAI
+t1#P#part_3.MAD
+t1#P#part_3.MAI
+t1#P#part_N.MAD
+t1#P#part_N.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MARIA,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = MARIA,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta.MAD
+t1#P#parta.MAI
+t1#P#partb.MAD
+t1#P#partb.MAI
+t1#P#partc.MAD
+t1#P#partc.MAI
+t1#P#partd.MAD
+t1#P#partd.MAI
+t1#P#parte.MAD
+t1#P#parte.MAI
+t1#P#partf.MAD
+t1#P#partf.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MARIA,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = MARIA,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MARIA,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MARIA) */
+
+unified filelist
+t1#P#parta#SP#partasp0.MAD
+t1#P#parta#SP#partasp0.MAI
+t1#P#parta#SP#partasp1.MAD
+t1#P#parta#SP#partasp1.MAI
+t1#P#partb#SP#partbsp0.MAD
+t1#P#partb#SP#partbsp0.MAI
+t1#P#partb#SP#partbsp1.MAD
+t1#P#partb#SP#partbsp1.MAI
+t1#P#partc#SP#partcsp0.MAD
+t1#P#partc#SP#partcsp0.MAI
+t1#P#partc#SP#partcsp1.MAD
+t1#P#partc#SP#partcsp1.MAI
+t1#P#partd#SP#partdsp0.MAD
+t1#P#partd#SP#partdsp0.MAI
+t1#P#partd#SP#partdsp1.MAD
+t1#P#partd#SP#partdsp1.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MARIA,
+ SUBPARTITION subpart12 ENGINE = MARIA),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MARIA,
+ SUBPARTITION subpart22 ENGINE = MARIA),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MARIA,
+ SUBPARTITION subpart32 ENGINE = MARIA),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MARIA,
+ SUBPARTITION subpart42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#subpart11.MAD
+t1#P#part1#SP#subpart11.MAI
+t1#P#part1#SP#subpart12.MAD
+t1#P#part1#SP#subpart12.MAI
+t1#P#part2#SP#subpart21.MAD
+t1#P#part2#SP#subpart21.MAI
+t1#P#part2#SP#subpart22.MAD
+t1#P#part2#SP#subpart22.MAI
+t1#P#part3#SP#subpart31.MAD
+t1#P#part3#SP#subpart31.MAI
+t1#P#part3#SP#subpart32.MAD
+t1#P#part3#SP#subpart32.MAI
+t1#P#part4#SP#subpart41.MAD
+t1#P#part4#SP#subpart41.MAI
+t1#P#part4#SP#subpart42.MAD
+t1#P#part4#SP#subpart42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ SUBPARTITION sp12 ENGINE = MARIA),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MARIA,
+ SUBPARTITION sp22 ENGINE = MARIA),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MARIA,
+ SUBPARTITION sp32 ENGINE = MARIA),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MARIA,
+ SUBPARTITION sp42 ENGINE = MARIA)) */
+
+unified filelist
+t1#P#part1#SP#sp11.MAD
+t1#P#part1#SP#sp11.MAI
+t1#P#part1#SP#sp12.MAD
+t1#P#part1#SP#sp12.MAI
+t1#P#part2#SP#sp21.MAD
+t1#P#part2#SP#sp21.MAI
+t1#P#part2#SP#sp22.MAD
+t1#P#part2#SP#sp22.MAI
+t1#P#part3#SP#sp31.MAD
+t1#P#part3#SP#sp31.MAI
+t1#P#part3#SP#sp32.MAD
+t1#P#part3#SP#sp32.MAI
+t1#P#part4#SP#sp41.MAD
+t1#P#part4#SP#sp41.MAI
+t1#P#part4#SP#sp42.MAD
+t1#P#part4#SP#sp42.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MARIA 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 = MARIA,
+ PARTITION part2 VALUES IN (1) ENGINE = MARIA,
+ PARTITION part3 VALUES IN (NULL) ENGINE = MARIA) */
+
+unified filelist
+t1#P#part1#SP#part1sp0.MAD
+t1#P#part1#SP#part1sp0.MAI
+t1#P#part1#SP#part1sp1.MAD
+t1#P#part1#SP#part1sp1.MAI
+t1#P#part1#SP#part1sp2.MAD
+t1#P#part1#SP#part1sp2.MAI
+t1#P#part2#SP#part2sp0.MAD
+t1#P#part2#SP#part2sp0.MAI
+t1#P#part2#SP#part2sp1.MAD
+t1#P#part2#SP#part2sp1.MAI
+t1#P#part2#SP#part2sp2.MAD
+t1#P#part2#SP#part2sp2.MAI
+t1#P#part3#SP#part3sp0.MAD
+t1#P#part3#SP#part3sp0.MAI
+t1#P#part3#SP#part3sp1.MAD
+t1#P#part3#SP#part3sp1.MAI
+t1#P#part3#SP#part3sp2.MAD
+t1#P#part3#SP#part3sp2.MAI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t0_aux;
+DROP TABLE IF EXISTS t0_definition;
+DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
new file mode 100644
index 00000000000..c63e8495f26
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result
@@ -0,0 +1,37643 @@
+SET @max_row = 20;
+SET @@session.storage_engine = 'MyISAM';
+
+#------------------------------------------------------------------------
+# 0. Setting of auxiliary variables + Creation of an auxiliary tables
+# needed in many testcases
+#------------------------------------------------------------------------
+SELECT @max_row DIV 2 INTO @max_row_div2;
+SELECT @max_row DIV 3 INTO @max_row_div3;
+SELECT @max_row DIV 4 INTO @max_row_div4;
+SET @max_int_4 = 2147483647;
+DROP TABLE IF EXISTS t0_template;
+CREATE TABLE t0_template (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) ,
+PRIMARY KEY(f_int1))
+ENGINE = MEMORY;
+# Logging of <max_row> INSERTs into t0_template suppressed
+DROP TABLE IF EXISTS t0_definition;
+CREATE TABLE t0_definition (
+state CHAR(3),
+create_command VARBINARY(5000),
+file_list VARBINARY(10000),
+PRIMARY KEY (state)
+) ENGINE = MEMORY;
+DROP TABLE IF EXISTS t0_aux;
+CREATE TABLE t0_aux ( f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000) )
+ENGINE = MEMORY;
+SET AUTOCOMMIT= 1;
+SET @@session.sql_mode= '';
+# End of basic preparations needed for all tests
+#-----------------------------------------------
+
+#========================================================================
+# 2 Decrease the size of the column used in the partitioning
+# function and/or PRIMARY KEY and/or UNIQUE INDEX
+#========================================================================
+#------------------------------------------------------------------------
+# 2.1 ALTER column f_int2 not used in partitioning function
+#------------------------------------------------------------------------
+# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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,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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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)
+(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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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_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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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_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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) 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_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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 2.1.3 UNIQUE INDEX exists
+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_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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,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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1 + 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+#------------------------------------------------------------------------
+# 2.3 ALTER column f_int1 and f_int2 used in partitioning function
+#------------------------------------------------------------------------
+# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
+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)
+
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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,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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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)
+(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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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_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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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_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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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_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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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)
+
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# check layout success: 1
+TRUNCATE t1;
+
+# check TRUNCATE success: 1
+# check layout success: 1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+# 2.3.3 UNIQUE INDEX exists
+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 uidx (f_int1,f_int2)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int1,f_int2)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
+(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
+
+unified filelist
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part0.MYD
+t1#P#part0.MYI
+t1#P#part1.MYD
+t1#P#part1.MYI
+t1#P#part2.MYD
+t1#P#part2.MYI
+t1#P#part3.MYD
+t1#P#part3.MYI
+t1#P#part_1.MYD
+t1#P#part_1.MYI
+t1#P#part_2.MYD
+t1#P#part_2.MYI
+t1#P#part_3.MYD
+t1#P#part_3.MYI
+t1#P#part_N.MYD
+t1#P#part_N.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta.MYD
+t1#P#parta.MYI
+t1#P#partb.MYD
+t1#P#partb.MYI
+t1#P#partc.MYD
+t1#P#partc.MYI
+t1#P#partd.MYD
+t1#P#partd.MYI
+t1#P#parte.MYD
+t1#P#parte.MYI
+t1#P#partf.MYD
+t1#P#partf.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#parta#SP#partasp0.MYD
+t1#P#parta#SP#partasp0.MYI
+t1#P#parta#SP#partasp1.MYD
+t1#P#parta#SP#partasp1.MYI
+t1#P#partb#SP#partbsp0.MYD
+t1#P#partb#SP#partbsp0.MYI
+t1#P#partb#SP#partbsp1.MYD
+t1#P#partb#SP#partbsp1.MYI
+t1#P#partc#SP#partcsp0.MYD
+t1#P#partc#SP#partcsp0.MYI
+t1#P#partc#SP#partcsp1.MYD
+t1#P#partc#SP#partcsp1.MYI
+t1#P#partd#SP#partdsp0.MYD
+t1#P#partd#SP#partdsp0.MYI
+t1#P#partd#SP#partdsp1.MYD
+t1#P#partd#SP#partdsp1.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#subpart11.MYD
+t1#P#part1#SP#subpart11.MYI
+t1#P#part1#SP#subpart12.MYD
+t1#P#part1#SP#subpart12.MYI
+t1#P#part2#SP#subpart21.MYD
+t1#P#part2#SP#subpart21.MYI
+t1#P#part2#SP#subpart22.MYD
+t1#P#part2#SP#subpart22.MYI
+t1#P#part3#SP#subpart31.MYD
+t1#P#part3#SP#subpart31.MYI
+t1#P#part3#SP#subpart32.MYD
+t1#P#part3#SP#subpart32.MYI
+t1#P#part4#SP#subpart41.MYD
+t1#P#part4#SP#subpart41.MYI
+t1#P#part4#SP#subpart42.MYD
+t1#P#part4#SP#subpart42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#sp11.MYD
+t1#P#part1#SP#sp11.MYI
+t1#P#part1#SP#sp12.MYD
+t1#P#part1#SP#sp12.MYI
+t1#P#part2#SP#sp21.MYD
+t1#P#part2#SP#sp21.MYI
+t1#P#part2#SP#sp22.MYD
+t1#P#part2#SP#sp22.MYI
+t1#P#part3#SP#sp31.MYD
+t1#P#part3#SP#sp31.MYI
+t1#P#part3#SP#sp32.MYD
+t1#P#part3#SP#sp32.MYI
+t1#P#part4#SP#sp41.MYD
+t1#P#part4#SP#sp41.MYI
+t1#P#part4#SP#sp42.MYD
+t1#P#part4#SP#sp42.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 uidx (f_int2,f_int1)
+)
+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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
+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` mediumint(9) DEFAULT NULL,
+ `f_int2` mediumint(9) DEFAULT NULL,
+ `f_char1` char(20) DEFAULT NULL,
+ `f_char2` char(20) DEFAULT NULL,
+ `f_charbig` varchar(1000) DEFAULT NULL,
+ UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
+) 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
+t1#P#part1#SP#part1sp0.MYD
+t1#P#part1#SP#part1sp0.MYI
+t1#P#part1#SP#part1sp1.MYD
+t1#P#part1#SP#part1sp1.MYI
+t1#P#part1#SP#part1sp2.MYD
+t1#P#part1#SP#part1sp2.MYI
+t1#P#part2#SP#part2sp0.MYD
+t1#P#part2#SP#part2sp0.MYI
+t1#P#part2#SP#part2sp1.MYD
+t1#P#part2#SP#part2sp1.MYI
+t1#P#part2#SP#part2sp2.MYD
+t1#P#part2#SP#part2sp2.MYI
+t1#P#part3#SP#part3sp0.MYD
+t1#P#part3#SP#part3sp0.MYI
+t1#P#part3#SP#part3sp1.MYD
+t1#P#part3#SP#part3sp1.MYI
+t1#P#part3#SP#part3sp2.MYD
+t1#P#part3#SP#part3sp2.MYI
+t1.frm
+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);
+ERROR 23000: Can't write; duplicate key in table 't1'
+# check prerequisites-3 success: 1
+# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
+CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# 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 COUNT(*) INTO @try_count FROM t0_template
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+SELECT COUNT(*) INTO @clash_count
+FROM t1 INNER JOIN t0_template USING(f_int1)
+WHERE MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+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##';
+Warnings:
+Warning 1264 Out of range value for column 'f_int1' at row 1
+Warning 1264 Out of range value for column 'f_int2' at row 1
+
+# 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#';
+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 MOD(f_int1,3) = 0
+AND f_int1 BETWEEN @max_row_div2 AND @max_row
+ON DUPLICATE KEY
+UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
+f_int2 = 2 * @max_row + source_tab.f_int1,
+f_charbig = 'was updated';
+
+# check unique-1-a success: 1
+
+# check unique-1-b success: 1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===')
+WHERE f_charbig = 'was updated';
+REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
+ FROM t0_template source_tab
+WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
+
+# check replace success: 1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
+DELETE FROM t1
+WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
+f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
+UPDATE t1 SET f_int2 = f_int1,
+f_char1 = CAST(f_int1 AS CHAR),
+f_char2 = CAST(f_int1 AS CHAR),
+f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
+WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
+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 status OK
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 <some_value>
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+# check layout success: 1
+REPAIR TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+# 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 VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t0_aux;
+DROP TABLE IF EXISTS t0_definition;
+DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_innodb.result
deleted file mode 100644
index a39ff23ad65..00000000000
--- a/mysql-test/suite/parts/r/partition_alter2_innodb.result
+++ /dev/null
@@ -1,118866 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'InnoDB';
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(10000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# 1 Increase the size of the column used in the partitioning
-# function and/or PRIMARY KEY and/or UNIQUE INDEX
-#========================================================================
-#------------------------------------------------------------------------
-# 1.1 ALTER column f_int2 not used in partitioning function
-#------------------------------------------------------------------------
-# 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists
-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)
-
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 1.1.2 PRIMARY KEY exists
-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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 1.1.3 UNIQUE INDEX exists
-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_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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,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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-(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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int1)
-(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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int1 + 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-#------------------------------------------------------------------------
-# 1.3 ALTER column f_int1 and f_int2
-# f_int1 or (f_int1 and f_int2) used in partitioning function
-#------------------------------------------------------------------------
-# 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
-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)
-
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 1.3.2 PRIMARY KEY exists
-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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) NOT NULL DEFAULT '0',
- `f_int2` bigint(20) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 1.3.3 UNIQUE INDEX exists
-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 uidx (f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
-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` bigint(20) DEFAULT NULL,
- `f_int2` bigint(20) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-
-#========================================================================
-# 2 Decrease the size of the column used in the partitioning
-# function and/or PRIMARY KEY and/or UNIQUE INDEX
-#========================================================================
-#------------------------------------------------------------------------
-# 2.1 ALTER column f_int2 not used in partitioning function
-#------------------------------------------------------------------------
-# 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists
-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)
-
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 2.1.3 UNIQUE INDEX exists
-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_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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,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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-(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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int1 + 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-#------------------------------------------------------------------------
-# 2.3 ALTER column f_int1 and f_int2 used in partitioning function
-#------------------------------------------------------------------------
-# 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
-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)
-
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 2.3.2 PRIMARY KEY exists
-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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int1,f_int2)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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)
-, PRIMARY KEY (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) NOT NULL DEFAULT '0',
- `f_int2` mediumint(9) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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;
-# 2.3.3 UNIQUE INDEX exists
-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 uidx (f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int1,f_int2)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY LIST(MOD(f_int1,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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) 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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 uidx (f_int2,f_int1)
-)
-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 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
-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` mediumint(9) DEFAULT NULL,
- `f_int2` mediumint(9) DEFAULT NULL,
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- UNIQUE KEY `uidx` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
-
-# 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);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# 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 COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-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##';
-Warnings:
-Warning 1264 Out of range value for column 'f_int1' at row 1
-Warning 1264 Out of range value for column 'f_int2' at row 1
-
-# 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#';
-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 MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-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;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be 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 able 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 status OK
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-# 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 VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result
index 888f9515a9c..cb104d4be54 100644
--- a/mysql-test/suite/parts/r/partition_alter3_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result
@@ -76,7 +76,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date)) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -93,7 +94,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -108,7 +110,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date)) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -129,7 +132,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -148,7 +155,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -164,7 +176,16 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB,
+ PARTITION p5 ENGINE = InnoDB,
+ PARTITION p6 ENGINE = InnoDB,
+ PARTITION p7 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -192,7 +213,15 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB,
+ PARTITION p5 ENGINE = InnoDB,
+ PARTITION p6 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -207,7 +236,14 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB,
+ PARTITION p5 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -222,7 +258,13 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -237,7 +279,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -252,7 +299,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -267,7 +318,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -282,7 +336,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -362,7 +418,8 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -386,7 +443,11 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -405,7 +466,12 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -424,7 +490,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB,
+ PARTITION p5 ENGINE = InnoDB,
+ PARTITION p6 ENGINE = InnoDB,
+ PARTITION p7 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -450,7 +525,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB,
+ PARTITION p5 ENGINE = InnoDB,
+ PARTITION p6 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -468,7 +551,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB,
+ PARTITION p5 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -486,7 +576,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB,
+ PARTITION p4 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -504,7 +600,12 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -522,7 +623,11 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB,
+ PARTITION part7 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -540,7 +645,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB,
+ PARTITION part1 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -558,7 +666,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = InnoDB) */
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result
index 488434d8d74..374b108b57e 100644
--- a/mysql-test/suite/parts/r/partition_alter3_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result
@@ -78,7 +78,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date)) */
t1#P#p0.MYD
t1#P#p0.MYI
t1.frm
@@ -97,7 +98,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
t1#P#p0.MYD
t1#P#p0.MYI
t1.frm
@@ -114,7 +116,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date)) */
t1#P#p0.MYD
t1#P#p0.MYI
t1.frm
@@ -137,7 +140,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -162,7 +169,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -186,7 +198,16 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 ENGINE = MyISAM,
+ PARTITION p6 ENGINE = MyISAM,
+ PARTITION p7 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -230,7 +251,15 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 ENGINE = MyISAM,
+ PARTITION p6 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -259,7 +288,14 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -286,7 +322,13 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -311,7 +353,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -334,7 +381,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -355,7 +406,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -374,7 +428,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (YEAR(f_date))
+(PARTITION p0 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1.frm
@@ -454,7 +510,8 @@ t1 CREATE TABLE `t1` (
`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) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1) */
t1#P#p0.MYD
t1#P#p0.MYI
t1.frm
@@ -480,7 +537,11 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -505,7 +566,12 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -532,7 +598,16 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 ENGINE = MyISAM,
+ PARTITION p6 ENGINE = MyISAM,
+ PARTITION p7 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -574,7 +649,15 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 ENGINE = MyISAM,
+ PARTITION p6 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -606,7 +689,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -636,7 +726,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p4.MYD
@@ -664,7 +760,12 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -690,7 +791,11 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM,
+ PARTITION part7 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -714,7 +819,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM,
+ PARTITION part1 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#part1.MYD
@@ -736,7 +844,9 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p0 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p0 ENGINE = MyISAM) */
t1#P#p0.MYD
t1#P#p0.MYI
t1.frm
diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result
index 8ec56dc5233..5d3143e35bb 100644
--- a/mysql-test/suite/parts/r/partition_alter4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result
@@ -74,7 +74,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -530,7 +533,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -994,7 +1003,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1456,7 +1474,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1914,7 +1939,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2378,7 +2410,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2840,7 +2886,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3300,7 +3360,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3758,7 +3824,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4214,7 +4283,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4678,7 +4753,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5140,7 +5224,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5598,7 +5689,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6062,7 +6160,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6524,7 +6636,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6984,7 +7110,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7442,7 +7574,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7898,7 +8033,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8362,7 +8503,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8824,7 +8974,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9282,7 +9439,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9746,7 +9910,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10208,7 +10386,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10668,7 +10860,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11126,7 +11324,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -11582,7 +11783,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12046,7 +12253,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12508,7 +12724,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -12966,7 +13189,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13430,7 +13660,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -13892,7 +14136,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14352,7 +14610,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14810,7 +15074,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15266,7 +15533,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15730,7 +16003,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16192,7 +16474,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16650,7 +16939,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17114,7 +17410,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17576,7 +17886,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18036,7 +18360,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18497,7 +18827,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18953,7 +19286,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -19417,7 +19756,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -19879,7 +20227,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20337,7 +20692,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20801,7 +21163,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21263,7 +21639,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21723,7 +22113,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22181,7 +22577,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22637,7 +23036,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23101,7 +23506,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -23563,7 +23977,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24021,7 +24442,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24485,7 +24913,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24947,7 +25389,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25407,7 +25863,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25865,7 +26327,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26321,7 +26786,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26785,7 +27256,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27247,7 +27727,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -27705,7 +28192,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -28169,7 +28663,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -28631,7 +29139,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -29091,7 +29613,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -29549,7 +30077,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30005,7 +30536,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30469,7 +31006,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -30931,7 +31477,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -31389,7 +31942,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -31853,7 +32413,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -32315,7 +32889,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -32775,7 +33363,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -33233,7 +33827,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -33689,7 +34286,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -34153,7 +34756,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -34615,7 +35227,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35073,7 +35692,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35537,7 +36163,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -35999,7 +36639,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -36459,7 +37113,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -36921,7 +37581,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -37378,7 +38041,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -37843,7 +38512,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -38306,7 +38984,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -38765,7 +39450,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -39230,7 +39922,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -39693,7 +40399,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -40154,7 +40874,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -40613,7 +41339,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -41070,7 +41799,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -41535,7 +42270,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -41998,7 +42742,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -42457,7 +43208,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -42922,7 +43680,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -43385,7 +44157,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -43846,7 +44632,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -44304,7 +45096,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -44760,7 +45555,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -45224,7 +46025,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -45686,7 +46496,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -46144,7 +46961,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -46608,7 +47432,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -47070,7 +47908,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -47530,7 +48382,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -47988,7 +48846,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -48444,7 +49305,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -48908,7 +49775,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -49370,7 +50246,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -49828,7 +50711,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -50292,7 +51182,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -50754,7 +51658,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -51214,7 +52132,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -51673,7 +52597,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -52130,7 +53057,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -52595,7 +53528,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -53058,7 +54000,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -53517,7 +54466,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -53982,7 +54938,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -54445,7 +55415,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -54906,7 +55890,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -55365,7 +56355,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -55819,7 +56812,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -56281,7 +57280,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -56741,7 +57749,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -57197,7 +58212,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -57659,7 +58681,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -58119,7 +59155,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -58577,7 +59627,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -59033,7 +60089,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -59487,7 +60546,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -59949,7 +61014,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -60409,7 +61483,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -60865,7 +61946,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -61327,7 +62415,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -61787,7 +62889,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -62245,7 +63361,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -63021,7 +64143,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -63475,7 +64600,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -63937,7 +65068,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -64397,7 +65537,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -64853,7 +66000,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -65315,7 +66469,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -65775,7 +66943,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -66233,7 +67415,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -66694,7 +67882,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -67150,7 +68341,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -67614,7 +68811,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -68076,7 +69282,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -68534,7 +69747,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -68998,7 +70218,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -69460,7 +70694,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -69920,7 +71168,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -70378,7 +71632,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -70834,7 +72091,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -71298,7 +72561,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -71760,7 +73032,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -72218,7 +73497,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -72682,7 +73968,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -73144,7 +74444,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -73604,7 +74918,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -74062,7 +75382,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -74518,7 +75841,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -74982,7 +76311,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -75444,7 +76782,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -75902,7 +77247,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -76366,7 +77718,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -76828,7 +78194,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -77288,7 +78668,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -77746,7 +79132,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -78202,7 +79591,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -78666,7 +80061,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -79128,7 +80532,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -79586,7 +80997,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -80050,7 +81468,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -80512,7 +81944,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -80972,7 +82418,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -81430,7 +82882,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -81886,7 +83341,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = InnoDB,
+ PARTITION part_2 ENGINE = InnoDB,
+ PARTITION part_3 ENGINE = InnoDB,
+ PARTITION part_4 ENGINE = InnoDB,
+ PARTITION part_5 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -82350,7 +83811,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -82812,7 +84282,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -83270,7 +84747,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -83734,7 +85218,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -84196,7 +85694,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -84656,7 +86168,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result
index e8d0e2afa37..c74a105306c 100644
--- a/mysql-test/suite/parts/r/partition_alter4_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result
@@ -74,7 +74,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -539,7 +542,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -1018,7 +1027,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -1501,7 +1519,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -1976,7 +2001,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -2461,7 +2493,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -2944,7 +2990,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -3425,7 +3485,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -3906,7 +3972,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -4371,7 +4440,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -4850,7 +4925,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -5333,7 +5417,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -5808,7 +5899,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -6293,7 +6391,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -6776,7 +6888,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -7257,7 +7383,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -7738,7 +7870,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -8203,7 +8338,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -8682,7 +8823,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -9165,7 +9315,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -9640,7 +9797,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -10125,7 +10289,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -10608,7 +10786,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -11089,7 +11281,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -11570,7 +11768,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -12035,7 +12236,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -12514,7 +12721,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -12997,7 +13213,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -13472,7 +13695,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -13957,7 +14187,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -14440,7 +14684,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -14921,7 +15179,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -15402,7 +15666,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -15867,7 +16134,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -16346,7 +16619,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -16829,7 +17111,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -17304,7 +17593,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -17789,7 +18085,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -18272,7 +18582,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -18753,7 +19077,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -19237,7 +19567,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -19702,7 +20035,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -20181,7 +20520,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -20664,7 +21012,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -21139,7 +21494,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -21624,7 +21986,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -22107,7 +22483,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -22588,7 +22978,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -23069,7 +23465,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -23534,7 +23933,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -24013,7 +24418,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -24496,7 +24910,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -24971,7 +25392,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -25456,7 +25884,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -25939,7 +26381,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -26420,7 +26876,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -26901,7 +27363,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -27366,7 +27831,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -27845,7 +28316,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -28328,7 +28808,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -28803,7 +29290,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -29288,7 +29782,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -29771,7 +30279,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -30252,7 +30774,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -30733,7 +31261,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -31198,7 +31729,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -31677,7 +32214,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -32160,7 +32706,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -32635,7 +33188,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -33120,7 +33680,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -33603,7 +34177,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -34084,7 +34672,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -34565,7 +35159,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -35030,7 +35627,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -35509,7 +36112,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -35992,7 +36604,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -36467,7 +37086,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -36952,7 +37578,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -37435,7 +38075,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -37916,7 +38570,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -38400,7 +39060,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -38865,7 +39528,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -39344,7 +40013,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -39827,7 +40505,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -40302,7 +40987,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -40787,7 +41479,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -41270,7 +41976,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -41751,7 +42471,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -42232,7 +42958,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -42697,7 +43426,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -43176,7 +43911,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -43659,7 +44403,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -44134,7 +44885,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -44619,7 +45377,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -45102,7 +45874,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -45583,7 +46369,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -46064,7 +46856,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -46529,7 +47324,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -47008,7 +47809,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -47491,7 +48301,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -47966,7 +48783,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -48451,7 +49275,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -48934,7 +49772,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -49415,7 +50267,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -49896,7 +50754,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -50361,7 +51222,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -50840,7 +51707,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -51323,7 +52199,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -51798,7 +52681,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -52283,7 +53173,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -52766,7 +53670,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -53247,7 +54165,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -53728,7 +54652,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -54193,7 +55120,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -54672,7 +55605,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -55155,7 +56097,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -55630,7 +56579,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -56115,7 +57071,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -56598,7 +57568,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -57079,7 +58063,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -57561,7 +58551,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -58024,7 +59017,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -58501,7 +59500,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -58982,7 +59990,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -59455,7 +60470,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -59938,7 +60960,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -60419,7 +61455,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -60898,7 +61948,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -61377,7 +62433,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -61840,7 +62899,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -62317,7 +63382,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -62798,7 +63872,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -63271,7 +64352,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -63754,7 +64842,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -64235,7 +65337,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -64714,7 +65830,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -65513,7 +66635,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -65976,7 +67101,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -66453,7 +67584,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -66934,7 +68074,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -67407,7 +68554,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -67890,7 +69044,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -68371,7 +69539,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -68850,7 +70032,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -69334,7 +70522,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -69799,7 +70990,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -70278,7 +71475,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -70761,7 +71967,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -71236,7 +72449,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -71721,7 +72941,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -72204,7 +73438,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -72685,7 +73933,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -73166,7 +74420,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -73631,7 +74888,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -74110,7 +75373,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -74593,7 +75865,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -75068,7 +76347,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -75553,7 +76839,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -76036,7 +77336,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -76517,7 +77831,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -76998,7 +78318,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -77463,7 +78786,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -77942,7 +79271,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -78425,7 +79763,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -78900,7 +80245,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -79385,7 +80737,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -79868,7 +81234,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -80349,7 +81729,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -80830,7 +82216,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -81295,7 +82684,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -81774,7 +83169,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -82257,7 +83661,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -82732,7 +84143,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -83217,7 +84635,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -83700,7 +85132,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -84181,7 +85627,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -84662,7 +86114,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -85127,7 +86582,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION part_1 ENGINE = MyISAM,
+ PARTITION part_2 ENGINE = MyISAM,
+ PARTITION part_3 ENGINE = MyISAM,
+ PARTITION part_4 ENGINE = MyISAM,
+ PARTITION part_5 ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -85606,7 +87067,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -86089,7 +87559,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1.MYD
@@ -86564,7 +88041,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1 DIV 2)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
@@ -87049,7 +88533,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part_1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#subpart11.MYD
@@ -87532,7 +89030,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3)))
+SUBPARTITION BY HASH (f_int1 + 1)
+(PARTITION part_1 VALUES IN (0)
+ (SUBPARTITION sp11 ENGINE = MyISAM,
+ SUBPARTITION sp12 ENGINE = MyISAM),
+ PARTITION part_2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = MyISAM,
+ SUBPARTITION sp22 ENGINE = MyISAM),
+ PARTITION part_3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = MyISAM,
+ SUBPARTITION sp32 ENGINE = MyISAM),
+ PARTITION part_4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = MyISAM,
+ SUBPARTITION sp42 ENGINE = MyISAM)) */
unified filelist
t1#P#part_1#SP#sp11.MYD
@@ -88013,7 +89525,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY (f_int1)
+SUBPARTITIONS 3
+(PARTITION part_1 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */
unified filelist
t1#P#part_1#SP#part_1sp0.MYD
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_archive.result b/mysql-test/suite/parts/r/partition_auto_increment_archive.result
new file mode 100644
index 00000000000..beda861425c
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_archive.result
@@ -0,0 +1,807 @@
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+# ERROR (only OK if Archive) mysql_errno: 1022
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+17
+19
+20
+21
+22
+30
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+6
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=8 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+6
+7
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='Archive'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+# ERROR (only OK if Archive) mysql_errno: 1022
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 1
+1 2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='Archive'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+# ERROR (only OK if Archive) mysql_errno: 1022
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 1
+1 2
+1 8
+2 3
+4 7
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+# ERROR (only OK if Archive) mysql_errno: 1022
+INSERT INTO t1 VALUES (NULL), (9);
+# ERROR (only OK if Archive) mysql_errno: 1022
+INSERT INTO t1 VALUES (59), (55);
+# ERROR (only OK if Archive) mysql_errno: 1022
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+17
+19
+20
+21
+22
+59
+60
+90
+91
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+5
+15
+25
+33
+34
+38
+40
+43
+46
+48
+52
+53
+58
+63
+69
+73
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+# ERROR (only OK if Archive) mysql_errno: 1022
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+17
+19
+20
+21
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+# ERROR (only OK if Archive) mysql_errno: 1022
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+17
+19
+20
+21
+22
+23
+24
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+17
+19
+20
+21
+22
+23
+24
+25
+26
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=28 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+17
+19
+20
+21
+22
+23
+24
+25
+26
+27
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# ERROR (only OK if Archive) mysql_errno: 1022
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Archive';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# ERROR (only OK if Archive) mysql_errno: 1022
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# ERROR (only OK if Archive) mysql_errno: 1022
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'Archive'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 3
+2 13
+2 14
+2 22
+2 23
+3 11
+3 12
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'Archive'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Archive'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+# ERROR (only OK if Archive) mysql_errno: 1022
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=17 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+15
+16
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+# ERROR (only OK if Archive) mysql_errno: 1022
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=302 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+15
+16
+300
+301
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+23
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Archive'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
new file mode 100644
index 00000000000..1946ebbf978
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
@@ -0,0 +1,644 @@
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='Blackhole'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='Blackhole'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL), (9);
+INSERT INTO t1 VALUES (59), (55);
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1 ORDER BY c1;
+c1
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Blackhole';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+# Test with another column after
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'Blackhole'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'Blackhole'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'Blackhole'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (3, NULL);
+INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+# ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (2, 22), (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+DROP TABLE t1;
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Blackhole'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=302 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Blackhole'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
new file mode 100644
index 00000000000..a30dfbcbe72
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
@@ -0,0 +1,823 @@
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+31
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+20
+22
+23
+25
+30
+31
+32
+40
+51
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+6
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='InnoDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='InnoDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+1 8
+2 3
+4 7
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL), (9);
+INSERT INTO t1 VALUES (59), (55);
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+141
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+9
+10
+20
+21
+22
+23
+55
+59
+60
+90
+91
+140
+141
+142
+151
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+5
+15
+25
+33
+34
+38
+40
+43
+46
+48
+52
+53
+58
+63
+69
+73
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+17
+19
+20
+21
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+15
+17
+19
+20
+21
+22
+23
+24
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+26
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'InnoDB';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with another column after
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'InnoDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 0
+1 1
+2 0
+2 1
+2 2
+2 22
+3 2
+4 3
+5 3
+6 2
+7 2
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'InnoDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 3
+2 13
+2 14
+2 22
+2 23
+3 11
+3 12
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'InnoDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'InnoDB'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+15
+16
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=302 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+0
+4
+15
+16
+300
+301
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+23
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='InnoDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_maria.result b/mysql-test/suite/parts/r/partition_auto_increment_maria.result
new file mode 100644
index 00000000000..c8ff7a11bfa
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_maria.result
@@ -0,0 +1,868 @@
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+52
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+20
+21
+22
+23
+30
+40
+51
+52
+53
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+SELECT * FROM t1 ORDER BY c1;
+c1
+6
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='MARIA'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='MARIA'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+1 8
+2 3
+4 7
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL), (9);
+INSERT INTO t1 VALUES (59), (55);
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+152
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+9
+10
+20
+21
+22
+23
+55
+59
+60
+90
+91
+140
+151
+152
+153
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+5
+15
+25
+33
+34
+38
+40
+43
+46
+48
+52
+53
+58
+63
+69
+73
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+17
+19
+20
+21
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+15
+17
+19
+20
+21
+22
+23
+24
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+26
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=28 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+27
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MARIA';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with another column after
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'MARIA'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 0
+1 1
+2 0
+2 1
+2 2
+2 22
+3 2
+4 3
+5 3
+6 2
+7 2
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'MARIA'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 3
+2 13
+2 14
+2 22
+2 23
+3 11
+3 12
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'MARIA'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (3, NULL);
+INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22), (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 1
+2 2
+2 3
+2 22
+2 23
+3 1
+3 2
+DROP TABLE t1;
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MARIA'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=17 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+15
+16
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=302 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+0
+4
+15
+16
+300
+301
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+23
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MARIA'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MARIA AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
new file mode 100644
index 00000000000..96925d206f6
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
@@ -0,0 +1,849 @@
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+52
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+20
+21
+22
+23
+30
+40
+51
+52
+53
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+6
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='Memory'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='Memory'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+1 8
+2 3
+4 7
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL), (9);
+INSERT INTO t1 VALUES (59), (55);
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+152
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+9
+10
+20
+21
+22
+23
+55
+59
+60
+90
+91
+140
+151
+152
+153
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+5
+15
+25
+33
+34
+38
+40
+43
+46
+48
+52
+53
+58
+63
+69
+73
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+17
+19
+20
+21
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+15
+17
+19
+20
+21
+22
+23
+24
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+26
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=28 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+27
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Memory';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with another column after
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'Memory'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 0
+1 1
+2 0
+2 1
+2 2
+2 22
+3 2
+4 3
+5 3
+6 2
+7 2
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'Memory'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 3
+2 13
+2 14
+2 22
+2 23
+3 11
+3 12
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'Memory'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Memory'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=17 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+15
+16
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=302 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+0
+4
+15
+16
+300
+301
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+23
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='Memory'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MEMORY AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
new file mode 100644
index 00000000000..204c241cfa8
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
@@ -0,0 +1,868 @@
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+52
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+20
+21
+22
+23
+30
+40
+51
+52
+53
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+6
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='MyISAM'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='MyISAM'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+1 8
+2 3
+4 7
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL), (9);
+INSERT INTO t1 VALUES (59), (55);
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+152
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+9
+10
+20
+21
+22
+23
+55
+59
+60
+90
+91
+140
+151
+152
+153
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+5
+15
+25
+33
+34
+38
+40
+43
+46
+48
+52
+53
+58
+63
+69
+73
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+17
+19
+20
+21
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+15
+17
+19
+20
+21
+22
+23
+24
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+26
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+27
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MyISAM';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with another column after
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'MyISAM'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 0
+1 1
+2 0
+2 1
+2 2
+2 22
+3 2
+4 3
+5 3
+6 2
+7 2
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'MyISAM'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 3
+2 13
+2 14
+2 22
+2 23
+3 11
+3 12
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'MyISAM'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (3, NULL);
+INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22), (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 1
+2 2
+2 3
+2 22
+2 23
+3 1
+3 2
+DROP TABLE t1;
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MyISAM'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+15
+16
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=301 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=302 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+0
+4
+15
+16
+300
+301
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+23
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='MyISAM'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_ndb.result b/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
new file mode 100644
index 00000000000..85e226b749b
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
@@ -0,0 +1,843 @@
+SET new=on;
+DROP TABLE IF EXISTS t1;
+# test without partitioning for reference
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID = 30;
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 50 WHERE c1 = 17;
+UPDATE t1 SET c1 = 51 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 40 WHERE c1 = 50;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+52
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+20
+21
+22
+23
+30
+40
+51
+52
+53
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+6
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# Simple test with NULL
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+# Test with sql_mode and first insert as 0
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='NDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (1, 1), (99, 99);
+INSERT INTO t1 VALUES (1, NULL);
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 VALUES (1, 0);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 100
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE='NDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1), (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (4, 7);
+INSERT INTO t1 VALUES (1, NULL);
+SELECT * FROM t1 ORDER BY c1, c2;
+c1 c2
+1 0
+1 1
+1 2
+1 8
+2 3
+4 7
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Simple test with NULL, 0 and explicit values both incr. and desc.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (2), (4), (NULL);
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (5), (16);
+INSERT INTO t1 VALUES (17), (19), (NULL);
+INSERT INTO t1 VALUES (NULL), (10), (NULL);
+INSERT INTO t1 VALUES (NULL), (9);
+INSERT INTO t1 VALUES (59), (55);
+INSERT INTO t1 VALUES (NULL), (90);
+INSERT INTO t1 VALUES (NULL);
+UPDATE t1 SET c1 = 150 WHERE c1 = 17;
+UPDATE t1 SET c1 = 151 WHERE c1 = 19;
+FLUSH TABLES;
+UPDATE t1 SET c1 = 140 WHERE c1 = 150;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+ AND TABLE_NAME='t1';
+AUTO_INCREMENT
+152
+UPDATE t1 SET c1 = NULL WHERE c1 = 4;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+9
+10
+20
+21
+22
+23
+55
+59
+60
+90
+91
+140
+151
+152
+153
+DROP TABLE t1;
+# Test with auto_increment_increment and auto_increment_offset.
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SET @@session.auto_increment_increment = 10;
+SET @@session.auto_increment_offset = 5;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SET @@session.auto_increment_increment = 5;
+SET @@session.auto_increment_offset = 3;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (33 + 1);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (38 + 2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (43 + 3);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (48 + 4);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (53 + 5);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (63 + 6);
+INSERT INTO t1 VALUES (NULL);
+SET @@session.auto_increment_increment = 1;
+SET @@session.auto_increment_offset = 1;
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+5
+15
+25
+33
+34
+38
+40
+43
+46
+48
+52
+53
+58
+63
+69
+73
+DROP TABLE t1;
+# Test reported auto_increment value
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB'
+PARTITION BY HASH (c1)
+PARTITIONS 2;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (2);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+3
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+6
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+22
+INSERT INTO t1 VALUES (10);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+17
+19
+20
+21
+INSERT INTO t1 VALUES (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
+AND TABLE_NAME='t1';
+AUTO_INCREMENT
+23
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+6
+10
+15
+17
+19
+20
+21
+22
+23
+24
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+26
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (NULL);
+DELETE FROM t1 WHERE c1 >= 100;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+DROP TABLE t1;
+# Test with two threads
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction NO PARTITIONING
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'NDB';
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (NULL);
+INSERT INTO t1 (c1) VALUES (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with two threads + start transaction
+# con default
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (2);
+INSERT INTO t1 (c1) VALUES (4);
+# con1
+START TRANSACTION;
+INSERT INTO t1 (c1) VALUES (NULL), (10);
+# con default
+INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
+INSERT INTO t1 (c1) VALUES (21);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+# con default
+INSERT INTO t1 (c1) VALUES (16);
+# con1
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+5
+10
+22
+23
+# con default
+INSERT INTO t1 (c1) VALUES (NULL);
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+COMMIT;
+SELECT * FROM t1 ORDER BY c1;
+c1
+2
+4
+5
+10
+11
+12
+16
+19
+21
+22
+23
+24
+DROP TABLE t1;
+# Test with another column after
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+c2 INT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'NDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (2, 0), (NULL, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (NULL, 2);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 0
+1 1
+2 0
+2 1
+2 2
+2 22
+3 2
+4 3
+5 3
+6 2
+7 2
+DROP TABLE t1;
+# Test with another column before
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c2))
+ENGINE = 'NDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (2, 22);
+INSERT INTO t1 VALUES (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 3
+2 13
+2 14
+2 22
+2 23
+3 11
+3 12
+DROP TABLE t1;
+# Test with auto_increment on secondary column in multi-column-index
+CREATE TABLE t1 (
+c1 INT,
+c2 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1,c2))
+ENGINE = 'NDB'
+PARTITION BY HASH(c2)
+PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (2, NULL);
+INSERT INTO t1 VALUES (3, NULL);
+INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
+INSERT INTO t1 VALUES (2, 2);
+# ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY
+INSERT INTO t1 VALUES (2, 22), (2, NULL);
+SELECT * FROM t1 ORDER BY c1,c2;
+c1 c2
+1 1
+1 2
+2 2
+2 3
+2 6
+2 7
+2 22
+2 23
+3 4
+3 5
+DROP TABLE t1;
+# Test AUTO_INCREMENT in CREATE
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'NDB'
+AUTO_INCREMENT = 15
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+15
+16
+# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
+SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t1 (c1) VALUES (300);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+0
+4
+15
+16
+300
+301
+SET @@session.sql_mode = '';
+DROP TABLE t1;
+# Test SET INSERT_ID
+CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
+ENGINE = 'NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1;
+c1
+1
+SET INSERT_ID = 23;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 (c1) VALUES (NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+1
+23
+DROP TABLE t1;
+# Testing with FLUSH TABLE
+CREATE TABLE t1 (
+c1 INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (c1))
+ENGINE='NDB'
+PARTITION BY HASH(c1)
+PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (4);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+INSERT INTO t1 VALUES (NULL);
+FLUSH TABLE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+PARTITIONS 2 */
+SELECT * FROM t1 ORDER BY c1;
+c1
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result
index 2f6e58b186a..15452792f3d 100644
--- a/mysql-test/suite/parts/r/partition_basic_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_innodb.result
@@ -72,7 +72,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -525,7 +527,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -986,7 +990,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -1445,7 +1458,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -1900,7 +1920,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -2361,7 +2388,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -2824,7 +2865,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -3281,7 +3336,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -3736,7 +3797,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -4189,7 +4252,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -4650,7 +4715,16 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -5109,7 +5183,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -5564,7 +5645,14 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -6023,7 +6111,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -6482,7 +6584,21 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -6939,7 +7055,13 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -7400,7 +7522,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -7890,7 +8014,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -8388,7 +8514,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -8884,7 +9019,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -9376,7 +9518,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -9874,7 +10023,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -10374,7 +10537,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -10868,7 +11045,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -11359,7 +11542,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -11849,7 +12034,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -12347,7 +12534,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -12843,7 +13039,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -13335,7 +13538,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -13833,7 +14043,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -14333,7 +14557,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -14827,7 +15065,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -15318,7 +15562,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -15824,7 +16070,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -16338,7 +16586,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -16850,7 +17107,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -17358,7 +17622,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -17872,7 +18143,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -18388,7 +18673,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -18898,7 +19197,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -19410,7 +19715,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -19900,7 +20207,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -20398,7 +20707,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -20894,7 +21212,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -21386,7 +21711,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -21882,7 +22214,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -22378,7 +22724,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -22872,7 +23232,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -23363,7 +23729,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -23853,7 +24221,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -24351,7 +24721,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -24847,7 +25226,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -25339,7 +25725,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -25835,7 +26228,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -26331,7 +26738,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -26825,7 +27246,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -27316,7 +27743,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1.frm
@@ -27822,7 +28251,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1.frm
@@ -28336,7 +28767,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
+ PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
+ PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
+ PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -28848,7 +29288,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
+ PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -29356,7 +29803,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
+ PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
t1.frm
@@ -29868,7 +30322,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = InnoDB,
+ SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -30380,7 +30848,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB 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 = InnoDB,
+ SUBPARTITION sp12 ENGINE = InnoDB),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 ENGINE = InnoDB,
+ SUBPARTITION sp22 ENGINE = InnoDB),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 ENGINE = InnoDB,
+ SUBPARTITION sp32 ENGINE = InnoDB),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 ENGINE = InnoDB,
+ SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
t1.frm
@@ -30890,7 +31372,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
+) ENGINE=InnoDB 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 = InnoDB,
+ PARTITION part2 VALUES IN (1) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
t1.frm
diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result
index abb9518f89a..84d623e63a2 100644
--- a/mysql-test/suite/parts/r/partition_basic_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_myisam.result
@@ -72,7 +72,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -530,7 +532,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -1002,7 +1006,16 @@ t1 CREATE TABLE `t1` (
`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,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) */
+) 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
t1#P#part0.MYD
@@ -1478,7 +1491,14 @@ t1 CREATE TABLE `t1` (
`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) (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) */
+) 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
t1#P#parta.MYD
@@ -1946,7 +1966,14 @@ t1 CREATE TABLE `t1` (
`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 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -2424,7 +2451,21 @@ t1 CREATE TABLE `t1` (
`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_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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -2904,7 +2945,21 @@ t1 CREATE TABLE `t1` (
`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_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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -3378,7 +3433,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -3852,7 +3913,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -4310,7 +4373,9 @@ t1 CREATE TABLE `t1` (
`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 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -4782,7 +4847,16 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part0.MYD
@@ -5258,7 +5332,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta.MYD
@@ -5726,7 +5807,14 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -6202,7 +6290,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -6678,7 +6780,21 @@ t1 CREATE TABLE `t1` (
`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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -7152,7 +7268,13 @@ t1 CREATE TABLE `t1` (
`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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -7632,7 +7754,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -8143,7 +8267,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -8668,7 +8794,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part0.MYD
@@ -9197,7 +9332,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta.MYD
@@ -9718,7 +9860,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -10249,7 +10398,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -10782,7 +10945,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -11309,7 +11486,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
@@ -11840,7 +12023,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -12351,7 +12536,9 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+PARTITIONS 5 */
unified filelist
t1#P#p0.MYD
@@ -12876,7 +13063,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part0.MYD
@@ -13405,7 +13601,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta.MYD
@@ -13926,7 +14129,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#parta#SP#partasp0.MYD
@@ -14455,7 +14665,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#subpart11.MYD
@@ -14984,7 +15208,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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)) */
+) 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
t1#P#part1#SP#sp11.MYD
@@ -15511,7 +15749,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) */
+) 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
t1#P#part1#SP#part1sp0.MYD
diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result
index 2fa1c25d0de..731cb186b34 100644
--- a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result
@@ -20,7 +20,10 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+(PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = InnoDB,
+ PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = InnoDB) */
ALTER TABLE t1 ENGINE = MyISAM;
# Verifying .frm, .par and MyISAM files (.MYD, MYI)
FLUSH TABLES;
@@ -28,5 +31,8 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (c1)
+(PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
index 2d7df9225ac..602a114c318 100644
--- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
@@ -82,7 +82,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -559,7 +562,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -1049,7 +1058,16 @@ t1 CREATE TABLE `t1` (
`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,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part0.MYD
@@ -1553,7 +1571,14 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta.MYD
@@ -2041,7 +2066,14 @@ t1 CREATE TABLE `t1` (
`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 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta#SP#partasp0.MYD
@@ -2539,7 +2571,21 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -3055,7 +3101,21 @@ t1 CREATE TABLE `t1` (
`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_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#sp11.MYD
@@ -3551,7 +3611,13 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part1#SP#part1sp0.MYD
@@ -4049,7 +4115,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -4526,7 +4595,13 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -5016,7 +5091,16 @@ t1 CREATE TABLE `t1` (
`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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part0.MYD
@@ -5520,7 +5604,14 @@ t1 CREATE TABLE `t1` (
`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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta.MYD
@@ -6008,7 +6099,14 @@ t1 CREATE TABLE `t1` (
`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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta#SP#partasp0.MYD
@@ -6504,7 +6602,21 @@ t1 CREATE TABLE `t1` (
`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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -7020,7 +7132,21 @@ t1 CREATE TABLE `t1` (
`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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#sp11.MYD
@@ -7516,7 +7642,13 @@ t1 CREATE TABLE `t1` (
`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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part1#SP#part1sp0.MYD
@@ -8020,7 +8152,10 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -8550,7 +8685,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -9093,7 +9234,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part0.MYD
@@ -9650,7 +9800,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta.MYD
@@ -10191,7 +10348,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta#SP#partasp0.MYD
@@ -10742,7 +10906,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -11311,7 +11489,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#sp11.MYD
@@ -11860,7 +12052,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part1#SP#part1sp0.MYD
@@ -12415,7 +12613,10 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1 + f_int2)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -12945,7 +13146,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (f_int1,f_int2)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -13488,7 +13695,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part0.MYD
@@ -14045,7 +14261,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta.MYD
@@ -14586,7 +14809,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int2)
+SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta#SP#partasp0.MYD
@@ -15135,7 +15365,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -15704,7 +15948,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#sp11.MYD
@@ -16253,7 +16511,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part1#SP#part1sp0.MYD
@@ -16804,7 +17068,10 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION p1 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -17327,7 +17594,13 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION p4 ENGINE = MyISAM,
+ PARTITION p5 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#p1.MYD
@@ -17865,7 +18138,16 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,4))
+(PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION part1 VALUES IN (1) ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#part0.MYD
@@ -18409,7 +18691,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+(PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM,
+ PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta.MYD
@@ -18940,7 +19229,14 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
+) 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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */
unified filelist
t1#P#parta#SP#partasp0.MYD
@@ -19456,19 +19752,20 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
+/*!50100 PARTITION BY RANGE(f_int1)
+SUBPARTITION BY KEY(f_int1)
+(PARTITION part1 VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
+(SUBPARTITION subpart11,
+SUBPARTITION subpart12),
+PARTITION part2 VALUES LESS THAN (5) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION subpart21,
+SUBPARTITION subpart22),
+PARTITION part3 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
+(SUBPARTITION subpart31,
+SUBPARTITION subpart32),
PARTITION part4 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
+(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;
# Start usability test (inc/partition_check.inc)
@@ -19483,7 +19780,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY KEY (f_int1)
+(PARTITION part1 VALUES LESS THAN (0)
+ (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (5)
+ (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES LESS THAN (10)
+ (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart41 ENGINE = MyISAM,
+ SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -19997,31 +20308,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
-(SUBPARTITION sp11
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
-SUBPARTITION sp12
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'),
-PARTITION part2 VALUES IN (1)
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
-(SUBPARTITION sp21
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir',
-SUBPARTITION sp22
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'),
-PARTITION part3 VALUES IN (2)
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'
-(SUBPARTITION sp31,
-SUBPARTITION sp32),
-PARTITION part4 VALUES IN (NULL)
-(SUBPARTITION sp41
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
-SUBPARTITION sp42
-DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir'
-INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'));
+/*!50100 PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) (PARTITION part1 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir', SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'), PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir', SUBPARTITION sp22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir'), PARTITION part3 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' (SUBPARTITION sp31, SUBPARTITION sp32), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir', SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir')) */;
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;
# Start usability test (inc/partition_check.inc)
@@ -20036,7 +20323,21 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
+) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part2 VALUES IN (1)
+ (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM,
+ SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part3 VALUES IN (2)
+ (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM),
+ PARTITION part4 VALUES IN (NULL)
+ (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM,
+ SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#sp11.MYD
diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result
index 22d1d0e0a30..2ea66592679 100644
--- a/mysql-test/suite/parts/r/partition_bit_innodb.result
+++ b/mysql-test/suite/parts/r/partition_bit_innodb.result
@@ -8,7 +8,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
drop table t1;
create table t1 (a bit(0), primary key (a)) engine='INNODB'
partition by key (a) (
@@ -19,7 +20,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 ENGINE = InnoDB, PARTITION pa2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 ENGINE = InnoDB,
+ PARTITION pa2 ENGINE = InnoDB) */
drop table t1;
create table t1 (a bit(64), primary key (a)) engine='INNODB'
partition by key (a) partitions 2;
@@ -28,7 +32,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 2 */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
@@ -54,7 +60,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
@@ -79,7 +90,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 4 */
insert into t2 values (b'0'), (b'1');
select hex(a) from t2;
hex(a)
@@ -90,7 +103,9 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0'
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 4 */
select hex(a) from t2;
hex(a)
0
@@ -101,7 +116,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 4 */
select hex(a) from t2;
hex(a)
0
@@ -118,7 +135,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` bit(8) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (64) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (256) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (3) ENGINE = InnoDB,
+ PARTITION pa2 VALUES LESS THAN (16) ENGINE = InnoDB,
+ PARTITION pa3 VALUES LESS THAN (64) ENGINE = InnoDB,
+ PARTITION pa4 VALUES LESS THAN (256) ENGINE = InnoDB) */
255 inserts;
select hex(a) from t3 where a=b'01010101';
hex(a)
@@ -394,7 +418,13 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` bit(8) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = InnoDB, PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = InnoDB,
+ PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = InnoDB,
+ PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = InnoDB) */
32 inserts;
select hex(a) from t4 where a=b'00000001';
hex(a)
diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result
index d4b81fc74b5..c1f067d80d1 100644
--- a/mysql-test/suite/parts/r/partition_bit_myisam.result
+++ b/mysql-test/suite/parts/r/partition_bit_myisam.result
@@ -8,7 +8,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
drop table t1;
create table t1 (a bit(0), primary key (a)) engine='MyISAM'
partition by key (a) (
@@ -19,7 +20,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 ENGINE = MyISAM, PARTITION pa2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 ENGINE = MyISAM,
+ PARTITION pa2 ENGINE = MyISAM) */
drop table t1;
create table t1 (a bit(64), primary key (a)) engine='MyISAM'
partition by key (a) partitions 2;
@@ -28,7 +32,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 2 */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
@@ -54,7 +60,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
@@ -79,7 +90,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 4 */
insert into t2 values (b'0'), (b'1');
select hex(a) from t2;
hex(a)
@@ -90,7 +103,9 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 4 */
select hex(a) from t2;
hex(a)
0
@@ -101,7 +116,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 4 */
select hex(a) from t2;
hex(a)
0
@@ -118,7 +135,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` bit(8) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (64) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (256) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM,
+ PARTITION pa2 VALUES LESS THAN (16) ENGINE = MyISAM,
+ PARTITION pa3 VALUES LESS THAN (64) ENGINE = MyISAM,
+ PARTITION pa4 VALUES LESS THAN (256) ENGINE = MyISAM) */
255 inserts;
select hex(a) from t3 where a=b'01010101';
hex(a)
@@ -394,7 +418,13 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` bit(8) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = MyISAM, PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = MyISAM,
+ PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = MyISAM,
+ PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = MyISAM) */
32 inserts;
select hex(a) from t4 where a=b'00000001';
hex(a)
diff --git a/mysql-test/suite/parts/r/partition_bit_ndb.result b/mysql-test/suite/parts/r/partition_bit_ndb.result
index a39b5717ca0..add3ed394ad 100644
--- a/mysql-test/suite/parts/r/partition_bit_ndb.result
+++ b/mysql-test/suite/parts/r/partition_bit_ndb.result
@@ -7,7 +7,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
drop table t1;
create table t1 (a bit(0), primary key (a)) partition by key (a) (
partition pa1 DATA DIRECTORY =
@@ -21,7 +22,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
+ PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
drop table t1;
create table t1 (a bit(64), primary key (a)) partition by key (a);
show create table t1;
@@ -29,7 +33,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
@@ -62,7 +67,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
insert into t1 values
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
@@ -83,7 +93,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
insert into t1 values (b'0'), (b'1');
select hex(a) from t1;
hex(a)
@@ -94,7 +105,8 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
select hex(a) from t1;
hex(a)
0
@@ -105,7 +117,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(1) NOT NULL DEFAULT '\0',
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
select hex(a) from t1;
hex(a)
0
diff --git a/mysql-test/suite/parts/r/partition_char_innodb.result b/mysql-test/suite/parts/r/partition_char_innodb.result
index 455ff0353ed..dc7d259c2af 100644
--- a/mysql-test/suite/parts/r/partition_char_innodb.result
+++ b/mysql-test/suite/parts/r/partition_char_innodb.result
@@ -10,7 +10,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64));
select * from t1;
a
@@ -36,7 +41,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` char(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26+54));
insert into t2 values (repeat(char(ascii('a')+1),25+54));
@@ -108,7 +115,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` binary(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64));
select hex(a) from t1;
hex(a)
@@ -137,7 +149,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` binary(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26+54));
insert into t2 values (repeat(char(ascii('a')+1),25+54));
@@ -209,7 +223,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64));
select * from t1;
a
@@ -235,7 +254,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` varchar(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26*26));
insert into t2 values (repeat(char(ascii('a')+1),25*25));
@@ -307,7 +328,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varbinary(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64));
select * from t1;
a
@@ -333,7 +359,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` varbinary(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 30 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 30 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26*26));
insert into t2 values (repeat(char(ascii('a')+1),25*25));
@@ -405,7 +433,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('A'),('D'),('L'),('G');
select * from t1;
a
@@ -442,7 +475,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` enum('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
0 inserts;
insert into t2 values (char(ascii('A')+26));
Warnings:
@@ -527,7 +562,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` set('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K');
select * from t1 order by a;
a
@@ -564,7 +604,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` set('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
insert into t2 values ('A'),('B'),('C'),('D'),('E'),('F'),('G'),('H'),('I'),('K'),('L'),('M'),('N'),('O'),('P'),('Q'),('S'),('T'),('U'),('V'),('X'),('Y'),('Z');
insert into t2 values ('A,B'),('B,C'),('C,D'),('D,E'),('E,F'),('F,G'),('G,H'),('H,I'),('I,J'),('K,L'),('L,M'),('M,N'),('N,O'),('O,P'),('P,Q'),('Q,R'),('S,T'),('T,U'),('U,V'),('V,W'),('X,Y'),('Y,Z'),('Z,A');
insert into t2 values ('A,B,C'),('B,C,D'),('C,D,E'),('D,E,F'),('E,F,G'),('F,G,H'),('G,H,I'),('H,I,J'),('I,J,K'),('K,L,M'),('L,M,N'),('M,N,O'),('N,O,P'),('O,P,Q'),('P,Q,R'),('Q,R,S'),('S,T,U'),('T,U,V'),('U,V,W'),('V,W,X'),('X,Y,Z'),('Y,Z,A'),('Z,A,B');
diff --git a/mysql-test/suite/parts/r/partition_char_myisam.result b/mysql-test/suite/parts/r/partition_char_myisam.result
index af25f4b19a4..80f738c4b7b 100644
--- a/mysql-test/suite/parts/r/partition_char_myisam.result
+++ b/mysql-test/suite/parts/r/partition_char_myisam.result
@@ -10,7 +10,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64));
select * from t1;
a
@@ -36,7 +41,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` char(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26+54));
insert into t2 values (repeat(char(ascii('a')+1),25+54));
@@ -108,7 +115,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` binary(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64));
select hex(a) from t1;
hex(a)
@@ -137,7 +149,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` binary(255) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26+54));
insert into t2 values (repeat(char(ascii('a')+1),25+54));
@@ -209,7 +223,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64));
select * from t1;
a
@@ -235,7 +254,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` varchar(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26*26));
insert into t2 values (repeat(char(ascii('a')+1),25*25));
@@ -307,7 +328,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varbinary(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64));
select * from t1;
a
@@ -333,7 +359,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` varbinary(767) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 30 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 30 */
26 inserts;
insert into t2 values (repeat(char(ascii('a')+0),26*26));
insert into t2 values (repeat(char(ascii('a')+1),25*25));
@@ -405,7 +433,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('A'),('D'),('L'),('G');
select * from t1;
a
@@ -442,7 +475,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` enum('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
0 inserts;
insert into t2 values (char(ascii('A')+26));
Warnings:
@@ -527,7 +562,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` set('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K');
select * from t1 order by a;
a
@@ -564,7 +604,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` set('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 27 */
insert into t2 values ('A'),('B'),('C'),('D'),('E'),('F'),('G'),('H'),('I'),('K'),('L'),('M'),('N'),('O'),('P'),('Q'),('S'),('T'),('U'),('V'),('X'),('Y'),('Z');
insert into t2 values ('A,B'),('B,C'),('C,D'),('D,E'),('E,F'),('F,G'),('G,H'),('H,I'),('I,J'),('K,L'),('L,M'),('M,N'),('N,O'),('O,P'),('P,Q'),('Q,R'),('S,T'),('T,U'),('U,V'),('V,W'),('X,Y'),('Y,Z'),('Z,A');
insert into t2 values ('A,B,C'),('B,C,D'),('C,D,E'),('D,E,F'),('E,F,G'),('F,G,H'),('G,H,I'),('H,I,J'),('I,J,K'),('K,L,M'),('L,M,N'),('M,N,O'),('N,O,P'),('O,P,Q'),('P,Q,R'),('Q,R,S'),('S,T,U'),('T,U,V'),('U,V,W'),('V,W,X'),('X,Y,Z'),('Y,Z,A'),('Z,A,B');
diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result
index 0d95df98bbf..67517ff5943 100644
--- a/mysql-test/suite/parts/r/partition_datetime_innodb.result
+++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59');
select * from t1;
a
@@ -34,7 +39,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
select * from t2;
a
@@ -190,7 +197,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -237,7 +251,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -282,7 +303,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15');
select * from t1;
a
@@ -307,7 +333,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15');
select * from t2;
a
@@ -513,7 +541,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (adddate(19700101,interval 12-1 month));
insert into t3 values (adddate(19700101,interval 11-1 month));
@@ -558,7 +593,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (adddate(19700101,interval 12-1 month));
insert into t4 values (adddate(19700101,interval 11-1 month));
@@ -601,7 +643,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59');
select * from t1;
a
@@ -626,7 +673,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('0:1:1'), ('10:11:12'), ('13:14:15'), ('14:15:16');
select * from t2;
a
@@ -782,7 +831,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (second(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */
59 inserts;
insert into t3 values (100000+59);
insert into t3 values (100000+58);
@@ -921,7 +977,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (second(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
59 inserts;
insert into t4 values (100000+59);
insert into t4 values (100000+58);
@@ -1058,7 +1121,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59');
select * from t1;
a
@@ -1083,7 +1151,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
select * from t2;
a
@@ -1239,7 +1309,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (adddate(19700101000000,interval 12-1 month));
insert into t3 values (adddate(19700101000000,interval 11-1 month));
@@ -1284,7 +1361,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB,
+ PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB,
+ PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB,
+ PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (adddate(19700101000000,interval 12-1 month));
insert into t4 values (adddate(19700101000000,interval 11-1 month));
@@ -1327,7 +1411,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` year(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values ('1975'), (2020), ('1980'), ('2000');
select * from t1;
a
@@ -1352,7 +1441,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` year(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975'), ('2020'), ('1980'), ('2000');
select * from t2;
a
diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result
index 4bb182281c4..ad542870e65 100644
--- a/mysql-test/suite/parts/r/partition_datetime_myisam.result
+++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59');
select * from t1;
a
@@ -34,7 +39,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
select * from t2;
a
@@ -190,7 +197,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -237,7 +251,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -282,7 +303,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15');
select * from t1;
a
@@ -307,7 +333,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15');
select * from t2;
a
@@ -513,7 +541,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (adddate(19700101,interval 12-1 month));
insert into t3 values (adddate(19700101,interval 11-1 month));
@@ -558,7 +593,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (adddate(19700101,interval 12-1 month));
insert into t4 values (adddate(19700101,interval 11-1 month));
@@ -601,7 +643,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59');
select * from t1;
a
@@ -626,7 +673,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('0:1:1'), ('10:11:12'), ('13:14:15'), ('14:15:16');
select * from t2;
a
@@ -782,7 +831,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (second(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */
59 inserts;
insert into t3 values (100000+59);
insert into t3 values (100000+58);
@@ -921,7 +977,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (second(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
59 inserts;
insert into t4 values (100000+59);
insert into t4 values (100000+58);
@@ -1058,7 +1121,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59');
select * from t1;
a
@@ -1083,7 +1151,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
select * from t2;
a
@@ -1239,7 +1309,14 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (adddate(19700101000000,interval 12-1 month));
insert into t3 values (adddate(19700101000000,interval 11-1 month));
@@ -1284,7 +1361,14 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (month(a))
+SUBPARTITION BY KEY (a)
+SUBPARTITIONS 3
+(PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM,
+ PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM,
+ PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM,
+ PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (adddate(19700101000000,interval 12-1 month));
insert into t4 values (adddate(19700101000000,interval 11-1 month));
@@ -1327,7 +1411,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` year(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values ('1975'), (2020), ('1980'), ('2000');
select * from t1;
a
@@ -1352,7 +1441,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` year(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 12 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 12 */
insert into t2 values ('1975'), ('2020'), ('1980'), ('2000');
select * from t2;
a
diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result
index 3aede5bb09b..70debf3c595 100644
--- a/mysql-test/suite/parts/r/partition_decimal_innodb.result
+++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` decimal(10,4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567);
select * from t1;
a
@@ -48,7 +53,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` decimal(18,9) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567);
select * from t2;
a
diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result
index 4ed9b94d008..f9f7a1e4fe2 100644
--- a/mysql-test/suite/parts/r/partition_decimal_myisam.result
+++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` decimal(10,4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567);
select * from t1;
a
@@ -48,7 +53,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` decimal(18,9) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567);
select * from t2;
a
diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result
index 638b1fc67e6..22ce5d75952 100644
--- a/mysql-test/suite/parts/r/partition_engine_innodb.result
+++ b/mysql-test/suite/parts/r/partition_engine_innodb.result
@@ -67,7 +67,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -522,7 +524,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -978,7 +983,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1495,7 +1508,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1988,7 +2009,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2442,7 +2471,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2896,7 +2933,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3352,7 +3392,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3809,7 +3857,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4259,7 +4315,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4711,7 +4769,12 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (1000)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result
index 233bffd75b0..41be1ce9303 100644
--- a/mysql-test/suite/parts/r/partition_engine_myisam.result
+++ b/mysql-test/suite/parts/r/partition_engine_myisam.result
@@ -67,7 +67,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -531,7 +533,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -996,7 +1001,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -1526,7 +1539,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -2032,7 +2053,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -2499,7 +2528,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -2966,7 +3003,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -3431,7 +3471,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -3901,7 +3949,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -4364,7 +4420,9 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part1 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -4823,7 +4881,12 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (1000)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
diff --git a/mysql-test/suite/parts/r/partition_engine_ndb.result b/mysql-test/suite/parts/r/partition_engine_ndb.result
index 2f184248c18..6662032ef53 100644
--- a/mysql-test/suite/parts/r/partition_engine_ndb.result
+++ b/mysql-test/suite/parts/r/partition_engine_ndb.result
@@ -67,7 +67,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -521,7 +523,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = ndbcluster,
+ PARTITION part2 ENGINE = ndbcluster) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -976,7 +981,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = ndbcluster,
+ SUBPARTITION subpart22 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1492,7 +1505,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = ndbcluster,
+ SUBPARTITION subpart22 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -1984,7 +2005,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = ndbcluster,
+ SUBPARTITION subpart22 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2437,7 +2466,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = ndbcluster,
+ SUBPARTITION subpart22 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -2890,7 +2927,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = ndbcluster,
+ PARTITION part2 ENGINE = ndbcluster) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3345,7 +3385,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = ndbcluster,
+ SUBPARTITION subpart22 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -3801,7 +3849,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = ndbcluster,
+ SUBPARTITION subpart22 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4250,7 +4306,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = ndbcluster) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4703,7 +4761,12 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster)) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (1000)
+ (SUBPARTITION subpart11 ENGINE = ndbcluster,
+ SUBPARTITION subpart12 ENGINE = ndbcluster)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result
index 8e1e1b51efd..917358dc54a 100644
--- a/mysql-test/suite/parts/r/partition_float_innodb.result
+++ b/mysql-test/suite/parts/r/partition_float_innodb.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` float NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5);
select * from t1;
a
@@ -40,7 +45,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` float NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5);
select * from t2;
a
@@ -92,7 +99,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` double NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t1;
a
@@ -125,7 +137,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` double NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t2;
a
diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result
index 9abd0fb11cd..3f9390f6ba9 100644
--- a/mysql-test/suite/parts/r/partition_float_myisam.result
+++ b/mysql-test/suite/parts/r/partition_float_myisam.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` float NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5);
select * from t1;
a
@@ -40,7 +45,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` float NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5);
select * from t2;
a
@@ -92,7 +99,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` double NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t1;
a
@@ -125,7 +137,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` double NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 10 */
insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t2;
a
diff --git a/mysql-test/suite/parts/r/partition_int_innodb.result b/mysql-test/suite/parts/r/partition_int_innodb.result
index 622f79616b0..7a51b80d5d7 100644
--- a/mysql-test/suite/parts/r/partition_int_innodb.result
+++ b/mysql-test/suite/parts/r/partition_int_innodb.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (255), (254), (253), (252), (1), (2), (128);
select * from t1;
a
@@ -40,7 +45,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (255), (254), (253), (252);
select * from t2;
a
@@ -70,7 +77,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` tinyint(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0);
select * from t3;
a
@@ -109,7 +118,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256);
select * from t1;
a
@@ -140,7 +154,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (65535), (65534), (65533), (65532);
select * from t2;
a
@@ -170,7 +186,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` smallint(6) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
select * from t3;
a
@@ -209,7 +227,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(10) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535);
select * from t1;
a
@@ -240,7 +263,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` int(10) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292);
select * from t2;
a
@@ -270,7 +295,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0);
select * from t3;
a
@@ -309,7 +336,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535);
select * from t1;
a
@@ -340,7 +372,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (16777215), (16777214), (16777213), (16777212);
select * from t2;
a
@@ -370,7 +404,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` mediumint(9) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0);
select * from t3;
a
@@ -409,7 +445,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
select * from t1;
a
@@ -452,7 +493,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t2;
a
@@ -482,7 +525,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` bigint(20) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
select * from t3;
a
diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result
index b9380dcda74..4387bbfdd78 100644
--- a/mysql-test/suite/parts/r/partition_int_myisam.result
+++ b/mysql-test/suite/parts/r/partition_int_myisam.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (255), (254), (253), (252), (1), (2), (128);
select * from t1;
a
@@ -40,7 +45,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (255), (254), (253), (252);
select * from t2;
a
@@ -70,7 +77,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` tinyint(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0);
select * from t3;
a
@@ -109,7 +118,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256);
select * from t1;
a
@@ -140,7 +154,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (65535), (65534), (65533), (65532);
select * from t2;
a
@@ -170,7 +186,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` smallint(6) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
select * from t3;
a
@@ -209,7 +227,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(10) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535);
select * from t1;
a
@@ -240,7 +263,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` int(10) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292);
select * from t2;
a
@@ -270,7 +295,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0);
select * from t3;
a
@@ -309,7 +336,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535);
select * from t1;
a
@@ -340,7 +372,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (16777215), (16777214), (16777213), (16777212);
select * from t2;
a
@@ -370,7 +404,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` mediumint(9) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0);
select * from t3;
a
@@ -409,7 +445,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
select * from t1;
a
@@ -452,7 +493,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t2;
a
@@ -482,7 +525,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` bigint(20) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
select * from t3;
a
diff --git a/mysql-test/suite/parts/r/partition_int_ndb.result b/mysql-test/suite/parts/r/partition_int_ndb.result
index e7eb19ca6e5..d3c2d80d6b4 100644
--- a/mysql-test/suite/parts/r/partition_int_ndb.result
+++ b/mysql-test/suite/parts/r/partition_int_ndb.result
@@ -9,7 +9,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
insert into t1 values (255), (254), (253), (252), (1), (2), (128);
select * from t1;
a
@@ -40,7 +45,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (255), (254), (253), (252);
select * from t2;
a
@@ -70,7 +77,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` tinyint(4) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0);
select * from t3;
a
@@ -109,7 +118,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256);
select * from t1;
a
@@ -140,7 +154,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (65535), (65534), (65533), (65532);
select * from t2;
a
@@ -170,7 +186,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` smallint(6) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
select * from t3;
a
@@ -209,7 +227,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(10) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535);
select * from t1;
a
@@ -240,7 +263,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` int(10) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292);
select * from t2;
a
@@ -270,7 +295,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0);
select * from t3;
a
@@ -309,7 +336,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535);
select * from t1;
a
@@ -340,7 +372,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (16777215), (16777214), (16777213), (16777212);
select * from t2;
a
@@ -370,7 +404,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` mediumint(9) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0);
select * from t3;
a
@@ -409,7 +445,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
select * from t1;
a
@@ -452,7 +493,9 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 8 */
insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t2;
a
@@ -482,7 +525,9 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` bigint(20) NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 7 */
insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
select * from t3;
a
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
index 2bb6e7421b1..7672ac330fb 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE,
+ PARTITION partE ENGINE = ARCHIVE,
+ PARTITION Partf ENGINE = ARCHIVE,
+ PARTITION PartG ENGINE = ARCHIVE) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -154,38 +170,46 @@ SHOW TABLES;
Tables_in_MySQL_Test_DB
TableA
tablea
+RENAME TABLE TableA to tableA;
SELECT * FROM tablea;
a
1
-1
10
+2
+7
+8
+9
+SELECT * FROM tableA;
+a
+1
10
11
12
2
-2
3
4
5
6
7
-7
-8
8
9
-9
+RENAME TABLE tableA to TableA;
SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
a
1
-1
10
11
12
@@ -195,11 +219,8 @@ a
5
6
7
-7
-8
8
9
-9
SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
@@ -270,7 +291,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE,
+ PARTITION partE ENGINE = ARCHIVE,
+ PARTITION Partf ENGINE = ARCHIVE,
+ PARTITION PartG ENGINE = ARCHIVE) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -290,7 +319,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -322,7 +355,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -369,52 +406,56 @@ SHOW TABLES;
Tables_in_MySQL_Test_DB
TableA
tablea
+RENAME TABLE TableA to tableA;
SELECT * FROM tablea;
a
1
-1
10
+2
+7
+8
+9
+SELECT * FROM tableA;
+a
+1
10
11
12
2
-2
3
4
5
6
7
-7
8
-8
-9
9
+RENAME TABLE tableA to TableA;
SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
a
1
-1
-10
10
11
12
2
-2
3
4
5
6
7
8
-8
-9
9
SHOW CREATE TABLE TableA;
Table Create Table
@@ -475,7 +516,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -498,7 +547,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -530,7 +585,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -577,54 +637,57 @@ SHOW TABLES;
Tables_in_MySQL_Test_DB
TableA
tablea
+RENAME TABLE TableA to tableA;
SELECT * FROM tablea;
a
1
-1
10
+2
+7
+8
+9
+SELECT * FROM tableA;
+a
+1
10
11
12
2
-2
3
4
5
6
7
-7
8
-8
-9
9
+RENAME TABLE tableA to TableA;
SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
a
1
-1
-10
10
11
12
2
-2
3
4
5
6
7
-7
-8
8
9
-9
SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
@@ -684,7 +747,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION partE VALUES IN (16) ENGINE = ARCHIVE,
+ PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE,
+ PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -707,7 +778,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -739,7 +816,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -780,47 +863,50 @@ SHOW TABLES;
Tables_in_MySQL_Test_DB
TableA
tablea
+RENAME TABLE TableA to tableA;
SELECT * FROM tablea;
a
1
-1
10
-12
2
+7
+8
+9
+SELECT * FROM tableA;
+a
+1
+12
3
4
5
6
7
-7
-8
8
9
-9
+RENAME TABLE tableA to TableA;
SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
a
1
-1
-10
12
-2
3
4
5
6
7
-7
8
-8
-9
9
SHOW CREATE TABLE TableA;
Table Create Table
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
index d603dbae9c2..e85cbeba594 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB,
+ PARTITION partE ENGINE = InnoDB,
+ PARTITION Partf ENGINE = InnoDB,
+ PARTITION PartG ENGINE = InnoDB) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -182,7 +198,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -270,7 +291,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB,
+ PARTITION partE ENGINE = InnoDB,
+ PARTITION Partf ENGINE = InnoDB,
+ PARTITION PartG ENGINE = InnoDB) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -290,7 +319,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -322,7 +355,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -397,7 +434,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -474,7 +516,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -497,7 +547,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -529,7 +585,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -604,7 +665,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -681,7 +747,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION partE VALUES IN (16) ENGINE = InnoDB,
+ PARTITION Partf VALUES IN (19) ENGINE = InnoDB,
+ PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -704,7 +778,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -736,7 +816,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -802,7 +888,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
index 092deae1796..1f7197abe6d 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY,
+ PARTITION partE ENGINE = MEMORY,
+ PARTITION Partf ENGINE = MEMORY,
+ PARTITION PartG ENGINE = MEMORY) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -182,7 +198,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -270,7 +291,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY,
+ PARTITION partE ENGINE = MEMORY,
+ PARTITION Partf ENGINE = MEMORY,
+ PARTITION PartG ENGINE = MEMORY) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -290,7 +319,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -322,7 +355,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -397,7 +434,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -474,7 +516,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -497,7 +547,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -529,7 +585,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -604,7 +665,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -681,7 +747,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION partE VALUES IN (16) ENGINE = MEMORY,
+ PARTITION Partf VALUES IN (19) ENGINE = MEMORY,
+ PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -704,7 +778,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -736,7 +816,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -802,7 +888,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
index 046fb40ab35..cb5228bd78e 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM,
+ PARTITION partE ENGINE = MyISAM,
+ PARTITION Partf ENGINE = MyISAM,
+ PARTITION PartG ENGINE = MyISAM) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -182,7 +198,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -270,7 +291,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM,
+ PARTITION partE ENGINE = MyISAM,
+ PARTITION Partf ENGINE = MyISAM,
+ PARTITION PartG ENGINE = MyISAM) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -290,7 +319,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -322,7 +355,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -397,7 +434,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -474,7 +516,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -497,7 +547,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -529,7 +585,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -604,7 +665,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
@@ -681,7 +747,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION partE VALUES IN (16) ENGINE = MyISAM,
+ PARTITION Partf VALUES IN (19) ENGINE = MyISAM,
+ PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -704,7 +778,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -736,7 +816,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -802,7 +888,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM) */
DROP TABLE tablea;
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
index 3d28cedf3bd..a1d0b78aac4 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster, PARTITION PartD ENGINE = ndbcluster, PARTITION partE ENGINE = ndbcluster, PARTITION Partf ENGINE = ndbcluster, PARTITION PartG ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ndbcluster,
+ PARTITION partB ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster,
+ PARTITION PartD ENGINE = ndbcluster,
+ PARTITION partE ENGINE = ndbcluster,
+ PARTITION Partf ENGINE = ndbcluster,
+ PARTITION PartG ENGINE = ndbcluster) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ndbcluster,
+ PARTITION partB ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
index b1eeed58ffb..f8238bb9382 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE,
+ PARTITION partE ENGINE = ARCHIVE,
+ PARTITION Partf ENGINE = ARCHIVE,
+ PARTITION PartG ENGINE = ARCHIVE) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE,
+ PARTITION partE ENGINE = ARCHIVE,
+ PARTITION Partf ENGINE = ARCHIVE,
+ PARTITION PartG ENGINE = ARCHIVE) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION partE VALUES IN (16) ENGINE = ARCHIVE,
+ PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE,
+ PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
index 910d985c0ea..5f7ccc3ed51 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB,
+ PARTITION partE ENGINE = InnoDB,
+ PARTITION Partf ENGINE = InnoDB,
+ PARTITION PartG ENGINE = InnoDB) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB,
+ PARTITION partE ENGINE = InnoDB,
+ PARTITION Partf ENGINE = InnoDB,
+ PARTITION PartG ENGINE = InnoDB) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION partE VALUES IN (16) ENGINE = InnoDB,
+ PARTITION Partf VALUES IN (19) ENGINE = InnoDB,
+ PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
index 0c6dfbeff94..c72666f7717 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY,
+ PARTITION partE ENGINE = MEMORY,
+ PARTITION Partf ENGINE = MEMORY,
+ PARTITION PartG ENGINE = MEMORY) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY,
+ PARTITION partE ENGINE = MEMORY,
+ PARTITION Partf ENGINE = MEMORY,
+ PARTITION PartG ENGINE = MEMORY) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION partE VALUES IN (16) ENGINE = MEMORY,
+ PARTITION Partf VALUES IN (19) ENGINE = MEMORY,
+ PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
index 714ae639e95..66f9f852108 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM,
+ PARTITION partE ENGINE = MyISAM,
+ PARTITION Partf ENGINE = MyISAM,
+ PARTITION PartG ENGINE = MyISAM) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM,
+ PARTITION partE ENGINE = MyISAM,
+ PARTITION Partf ENGINE = MyISAM,
+ PARTITION PartG ENGINE = MyISAM) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION partE VALUES IN (16) ENGINE = MyISAM,
+ PARTITION Partf VALUES IN (19) ENGINE = MyISAM,
+ PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
index 3bf9b073c80..c27f769ad72 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster, PARTITION PartD ENGINE = ndbcluster, PARTITION partE ENGINE = ndbcluster, PARTITION Partf ENGINE = ndbcluster, PARTITION PartG ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ndbcluster,
+ PARTITION partB ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster,
+ PARTITION PartD ENGINE = ndbcluster,
+ PARTITION partE ENGINE = ndbcluster,
+ PARTITION Partf ENGINE = ndbcluster,
+ PARTITION PartG ENGINE = ndbcluster) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ndbcluster,
+ PARTITION partB ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
index cdc278f36cd..70020ee54a6 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE,
+ PARTITION partE ENGINE = ARCHIVE,
+ PARTITION Partf ENGINE = ARCHIVE,
+ PARTITION PartG ENGINE = ARCHIVE) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE,
+ PARTITION PartD ENGINE = ARCHIVE,
+ PARTITION partE ENGINE = ARCHIVE,
+ PARTITION Partf ENGINE = ARCHIVE,
+ PARTITION PartG ENGINE = ARCHIVE) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = ARCHIVE,
+ PARTITION partB ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE,
+ PARTITION Partc ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION partE VALUES IN (16) ENGINE = ARCHIVE,
+ PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE,
+ PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE,
+ PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
index 6a71a2e2f44..7392056b7a5 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB,
+ PARTITION partE ENGINE = InnoDB,
+ PARTITION Partf ENGINE = InnoDB,
+ PARTITION PartG ENGINE = InnoDB) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB,
+ PARTITION PartD ENGINE = InnoDB,
+ PARTITION partE ENGINE = InnoDB,
+ PARTITION Partf ENGINE = InnoDB,
+ PARTITION PartG ENGINE = InnoDB) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = InnoDB,
+ PARTITION partB ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB,
+ PARTITION Partc ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION partE VALUES IN (16) ENGINE = InnoDB,
+ PARTITION Partf VALUES IN (19) ENGINE = InnoDB,
+ PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB,
+ PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
index 988f60042e5..a71bbfea5e3 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY,
+ PARTITION partE ENGINE = MEMORY,
+ PARTITION Partf ENGINE = MEMORY,
+ PARTITION PartG ENGINE = MEMORY) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY,
+ PARTITION PartD ENGINE = MEMORY,
+ PARTITION partE ENGINE = MEMORY,
+ PARTITION Partf ENGINE = MEMORY,
+ PARTITION PartG ENGINE = MEMORY) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MEMORY,
+ PARTITION partB ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY,
+ PARTITION Partc ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION partE VALUES IN (16) ENGINE = MEMORY,
+ PARTITION Partf VALUES IN (19) ENGINE = MEMORY,
+ PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY,
+ PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
index c586347f23c..92b64e4d26c 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM,
+ PARTITION partE ENGINE = MyISAM,
+ PARTITION Partf ENGINE = MyISAM,
+ PARTITION PartG ENGINE = MyISAM) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -262,7 +282,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM,
+ PARTITION PartD ENGINE = MyISAM,
+ PARTITION partE ENGINE = MyISAM,
+ PARTITION Partf ENGINE = MyISAM,
+ PARTITION PartG ENGINE = MyISAM) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -282,7 +310,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION parta ENGINE = MyISAM,
+ PARTITION partB ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -314,7 +346,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -382,7 +418,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM,
+ PARTITION Partc ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -458,7 +498,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM,
+ PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM,
+ PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM,
+ PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -481,7 +529,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM,
+ PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM,
+ PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
# Error since it must reorganize a consecutive range
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
@@ -513,7 +567,12 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -581,7 +640,12 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM,
+ PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM,
+ PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
@@ -657,7 +721,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION partE VALUES IN (16) ENGINE = MyISAM,
+ PARTITION Partf VALUES IN (19) ENGINE = MyISAM,
+ PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */
ALTER TABLE TableA DROP PARTITION partE, PartG;
ALTER TABLE TableA DROP PARTITION Partf;
ALTER TABLE TableA ADD PARTITION
@@ -680,7 +752,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM,
+ PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM,
+ PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of REORGANIZE PARTITIONS
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
(PARTITION Partc VALUES IN (1,7)
@@ -712,7 +790,13 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -771,7 +855,13 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM,
+ PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM,
+ PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
index 1c9952370f0..b234de0efdb 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
@@ -55,7 +55,15 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster, PARTITION PartD ENGINE = ndbcluster, PARTITION partE ENGINE = ndbcluster, PARTITION Partf ENGINE = ndbcluster, PARTITION PartG ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ndbcluster,
+ PARTITION partB ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster,
+ PARTITION PartD ENGINE = ndbcluster,
+ PARTITION partE ENGINE = ndbcluster,
+ PARTITION Partf ENGINE = ndbcluster,
+ PARTITION PartG ENGINE = ndbcluster) */
ALTER TABLE TableA COALESCE PARTITION 4;
SELECT * FROM TableA;
a
@@ -75,7 +83,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION parta ENGINE = ndbcluster,
+ PARTITION partB ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of REORGANIZE PARTITIONS
# Should not work on HASH/KEY
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
@@ -107,7 +119,11 @@ SHOW CREATE TABLE TableA;
Table Create Table
TableA CREATE TABLE `TableA` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of RENAME TABLE
RENAME TABLE TableA to TableB;
SELECT * FROM TableB;
@@ -175,7 +191,11 @@ SHOW CREATE TABLE tablea;
Table Create Table
tablea CREATE TABLE `tablea` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
+ PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
+ PARTITION Partc ENGINE = ndbcluster) */
# Test of REMOVE PARTITIONING
ALTER TABLE TableA REMOVE PARTITIONING;
SELECT * FROM TableA;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 35954c0f66a..5eab78de8c2 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -12,7 +12,12 @@ t1 CREATE TABLE `t1` (
`c` varchar(50) NOT NULL,
`d` enum('m','w') NOT NULL DEFAULT 'm',
PRIMARY KEY (`a`,`b`,`c`,`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m'),
('1983-12-31', 'cdef', 'srtbvsr', 'w'),
@@ -49,7 +54,12 @@ t1 CREATE TABLE `t1` (
`h` tinyint(4) NOT NULL,
`i` char(255) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
@@ -94,7 +104,12 @@ t1 CREATE TABLE `t1` (
`h1` tinyint(4) NOT NULL,
`i` char(255) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
@@ -162,7 +177,12 @@ t1 CREATE TABLE `t1` (
`h3` tinyint(4) NOT NULL,
`i` char(255) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index f0a66ac847f..7167d6af39e 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -12,7 +12,12 @@ t1 CREATE TABLE `t1` (
`c` varchar(50) NOT NULL,
`d` enum('m','w') NOT NULL DEFAULT 'm',
PRIMARY KEY (`a`,`b`,`c`,`d`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m'),
('1983-12-31', 'cdef', 'srtbvsr', 'w'),
@@ -49,7 +54,12 @@ t1 CREATE TABLE `t1` (
`h` tinyint(4) NOT NULL,
`i` char(255) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
@@ -94,7 +104,12 @@ t1 CREATE TABLE `t1` (
`h1` tinyint(4) NOT NULL,
`i` char(255) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
@@ -162,7 +177,12 @@ t1 CREATE TABLE `t1` (
`h3` tinyint(4) NOT NULL,
`i` char(255) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h)
+(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM,
+ PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM,
+ PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM,
+ PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result
index a26d2ec65b9..ef5d27cfc36 100644
--- a/mysql-test/suite/parts/r/partition_syntax_innodb.result
+++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result
@@ -659,7 +659,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB, PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,2))
+(PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */
DROP TABLE t1;
# 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0)
@@ -683,7 +686,11 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB, PARTITION part2 VALUES IN (0) ENGINE = InnoDB, PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,2))
+(PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB,
+ PARTITION part2 VALUES IN (0) ENGINE = InnoDB,
+ PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */
DROP TABLE t1;
@@ -713,7 +720,8 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1) */
DROP TABLE t1;
# 4.1.2 no partition number, named partitions
@@ -734,7 +742,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
DROP TABLE t1;
# 4.1.3 variations on no partition/subpartition number, named partitions,
@@ -817,7 +828,18 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (20) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (20)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB),
+ PARTITION part3 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart31 ENGINE = InnoDB,
+ SUBPARTITION subpart32 ENGINE = InnoDB)) */
DROP TABLE t1;
#------------------------------------------------------------------------
@@ -842,7 +864,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
DROP TABLE t1;
CREATE TABLE t1 (
@@ -865,7 +889,12 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
DROP TABLE t1;
CREATE TABLE t1 (
@@ -885,7 +914,9 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 1 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 1 */
DROP TABLE t1;
CREATE TABLE t1 (
@@ -908,7 +939,12 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 1
+(PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
DROP TABLE t1;
CREATE TABLE t1 (
@@ -1647,7 +1683,10 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = InnoDB,
+ PARTITION part2 ENGINE = InnoDB) */
DROP TABLE t1;
CREATE TABLE t1 (
@@ -1673,7 +1712,15 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (1000)
+ (SUBPARTITION subpart11 ENGINE = InnoDB,
+ SUBPARTITION subpart12 ENGINE = InnoDB),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = InnoDB,
+ SUBPARTITION subpart22 ENGINE = InnoDB)) */
DROP TABLE t1;
# 4.3.2 (positive) number of partition/subpartition ,
diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result
index ab2a5797cd7..1461534e1a3 100644
--- a/mysql-test/suite/parts/r/partition_syntax_myisam.result
+++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result
@@ -659,7 +659,10 @@ t1 CREATE TABLE `t1` (
`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,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM, PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,2))
+(PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -691,7 +694,11 @@ t1 CREATE TABLE `t1` (
`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,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM, PARTITION part2 VALUES IN (0) ENGINE = MyISAM, PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (MOD(f_int1,2))
+(PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM,
+ PARTITION part2 VALUES IN (0) ENGINE = MyISAM,
+ PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -731,7 +738,8 @@ t1 CREATE TABLE `t1` (
`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) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1) */
unified filelist
t1#P#p0.MYD
@@ -758,7 +766,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -849,7 +860,18 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (20) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (10)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (20)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM),
+ PARTITION part3 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart31 ENGINE = MyISAM,
+ SUBPARTITION subpart32 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
@@ -890,7 +912,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 2 */
unified filelist
t1#P#p0.MYD
@@ -921,7 +945,12 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 2
+(PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part1#SP#part1sp0.MYD
@@ -953,7 +982,9 @@ t1 CREATE TABLE `t1` (
`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) PARTITIONS 1 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+PARTITIONS 1 */
unified filelist
t1#P#p0.MYD
@@ -982,7 +1013,12 @@ t1 CREATE TABLE `t1` (
`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_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+SUBPARTITIONS 1
+(PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
unified filelist
t1#P#part1#SP#part1sp0.MYD
@@ -1729,7 +1765,10 @@ t1 CREATE TABLE `t1` (
`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) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (f_int1)
+(PARTITION part1 ENGINE = MyISAM,
+ PARTITION part2 ENGINE = MyISAM) */
unified filelist
t1#P#part1.MYD
@@ -1763,7 +1802,15 @@ t1 CREATE TABLE `t1` (
`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_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (f_int1)
+SUBPARTITION BY HASH (f_int1)
+(PARTITION part1 VALUES LESS THAN (1000)
+ (SUBPARTITION subpart11 ENGINE = MyISAM,
+ SUBPARTITION subpart12 ENGINE = MyISAM),
+ PARTITION part2 VALUES LESS THAN (2147483646)
+ (SUBPARTITION subpart21 ENGINE = MyISAM,
+ SUBPARTITION subpart22 ENGINE = MyISAM)) */
unified filelist
t1#P#part1#SP#subpart11.MYD
diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
index bd77d4317bd..e330175bc0c 100644
--- a/mysql-test/suite/parts/r/rpl_partition.result
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -121,7 +121,21 @@ Create Table CREATE TABLE `t3` (
`fkid` mediumint(9) DEFAULT NULL,
`filler` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM, PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM, PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM, PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+SUBPARTITION BY HASH (id)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM,
+ PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM,
+ PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM,
+ PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM,
+ PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM,
+ PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index 1885e17d73d..b9cd3462635 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -1,4 +1,3 @@
-partition_alter2_ndb : Bug#18735 Not supported
partition_basic_ndb : Bug#19899 Crashing the server
# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
partition_bit_ndb : NDB does not support bit column in index
diff --git a/mysql-test/suite/parts/t/partition_alter2_innodb.test b/mysql-test/suite/parts/t/partition_alter2_1_innodb.test
index a5efdc71437..b5f29e4ad72 100644
--- a/mysql-test/suite/parts/t/partition_alter2_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter2_1_innodb.test
@@ -1,5 +1,5 @@
################################################################################
-# t/partition_alter2_innodb.test #
+# t/partition_alter2_1_innodb.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
@@ -70,7 +70,7 @@ let $MAX_VALUE= (2147483646);
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_alter2.inc
+--source suite/parts/inc/partition_alter2_1.inc
#------------------------------------------------------------------------------#
# Execute storage engine specific tests
diff --git a/mysql-test/suite/parts/t/partition_alter2_1_maria.test b/mysql-test/suite/parts/t/partition_alter2_1_maria.test
new file mode 100644
index 00000000000..27655b154cb
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_alter2_1_maria.test
@@ -0,0 +1,80 @@
+################################################################################
+# t/partition_alter2_1_maria.test #
+# #
+# Purpose: #
+# Tests around Alter column used in partitioning function #
+# MARIA branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: mleich #
+# Original Date: 2006-03-05 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MARIA SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+# Please read the README at the end of inc/partition.pre before changing
+# any of the variables.
+#
+
+#------------------------------------------------------------------------------#
+# General not engine specific settings and requirements
+
+##### Options, for debugging support #####
+let $debug= 0;
+let $with_partitioning= 1;
+
+##### Option, for displaying files #####
+let $ls= 1;
+
+##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
+# on partioned tables
+SET @max_row = 20;
+
+##### Execute more tests #####
+let $more_trigger_tests= 0;
+let $more_pk_ui_tests= 0;
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+--source include/have_maria.inc
+let $engine= 'MARIA';
+
+##### Execute the test of "table" files
+# MARIA has files per PK, UI, ...
+let $do_file_tests= 1;
+
+##### Execute PRIMARY KEY tests #####
+# AFAIK MARIA treats PRIMARY KEYs like UNIQUE INDEXes
+let $do_pk_tests= 0;
+
+##### Assign a big number smaller than the maximum value for partitions #####
+# and smaller than the maximum value of SIGNED INTEGER
+let $MAX_VALUE= (2147483646);
+
+# Generate the prerequisites ($variables, @variables, tables) needed
+--source suite/parts/inc/partition.pre
+
+##### Workarounds for known open engine specific bugs
+# none
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_alter2_1.inc
+
+#------------------------------------------------------------------------------#
+# Execute storage engine specific tests
+
+#------------------------------------------------------------------------------#
+# Cleanup
+--source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_alter2_myisam.test b/mysql-test/suite/parts/t/partition_alter2_1_myisam.test
index a5b6380ef15..fa88b739f29 100644
--- a/mysql-test/suite/parts/t/partition_alter2_myisam.test
+++ b/mysql-test/suite/parts/t/partition_alter2_1_myisam.test
@@ -1,5 +1,5 @@
################################################################################
-# t/partition_alter2_myisam.test #
+# t/partition_alter2_1_myisam.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
@@ -69,7 +69,7 @@ let $MAX_VALUE= (2147483646);
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_alter2.inc
+--source suite/parts/inc/partition_alter2_1.inc
#------------------------------------------------------------------------------#
# Execute storage engine specific tests
diff --git a/mysql-test/suite/parts/t/partition_alter2_ndb.test b/mysql-test/suite/parts/t/partition_alter2_2_innodb.test
index fd1437ede71..1d8ac251aca 100644
--- a/mysql-test/suite/parts/t/partition_alter2_ndb.test
+++ b/mysql-test/suite/parts/t/partition_alter2_2_innodb.test
@@ -1,9 +1,9 @@
################################################################################
-# t/partition_alter2_ndb.test #
+# t/partition_alter2_2_innodb.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
-# NDB branch #
+# InnoDB branch #
# #
#------------------------------------------------------------------------------#
# Original Author: mleich #
@@ -14,7 +14,7 @@
################################################################################
#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
+# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
# THE SOURCED FILES ONLY.
#
@@ -40,35 +40,26 @@ SET @max_row = 20;
let $more_trigger_tests= 0;
let $more_pk_ui_tests= 0;
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
+# The server must support partitioning.
+--source include/have_partition.inc
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
+--source include/have_innodb.inc
+let $engine= 'InnoDB';
+
##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
+# InnoDB has no files per PK, UI, ...
let $do_file_tests= 0;
##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
+# AFAIK InnoDB clusters the table around PRIMARY KEYs.
let $do_pk_tests= 1;
##### Assign a big number smaller than the maximum value for partitions #####
# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
let $MAX_VALUE= (2147483646);
# Generate the prerequisites ($variables, @variables, tables) needed
@@ -79,7 +70,7 @@ let $MAX_VALUE= (2147483646);
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_alter2.inc
+--source suite/parts/inc/partition_alter2_2.inc
#------------------------------------------------------------------------------#
# Execute storage engine specific tests
diff --git a/mysql-test/suite/parts/t/partition_alter2_2_maria.test b/mysql-test/suite/parts/t/partition_alter2_2_maria.test
new file mode 100644
index 00000000000..a87bc0e7ef1
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_alter2_2_maria.test
@@ -0,0 +1,80 @@
+################################################################################
+# t/partition_alter2_2_maria.test #
+# #
+# Purpose: #
+# Tests around Alter column used in partitioning function #
+# MARIA branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: mleich #
+# Original Date: 2006-03-05 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MARIA SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+# Please read the README at the end of inc/partition.pre before changing
+# any of the variables.
+#
+
+#------------------------------------------------------------------------------#
+# General not engine specific settings and requirements
+
+##### Options, for debugging support #####
+let $debug= 0;
+let $with_partitioning= 1;
+
+##### Option, for displaying files #####
+let $ls= 1;
+
+##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
+# on partioned tables
+SET @max_row = 20;
+
+##### Execute more tests #####
+let $more_trigger_tests= 0;
+let $more_pk_ui_tests= 0;
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+--source include/have_maria.inc
+let $engine= 'MARIA';
+
+##### Execute the test of "table" files
+# MAARIA has files per PK, UI, ...
+let $do_file_tests= 1;
+
+##### Execute PRIMARY KEY tests #####
+# AFAIK MARIA treats PRIMARY KEYs like UNIQUE INDEXes
+let $do_pk_tests= 0;
+
+##### Assign a big number smaller than the maximum value for partitions #####
+# and smaller than the maximum value of SIGNED INTEGER
+let $MAX_VALUE= (2147483646);
+
+# Generate the prerequisites ($variables, @variables, tables) needed
+--source suite/parts/inc/partition.pre
+
+##### Workarounds for known open engine specific bugs
+# none
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_alter2_2.inc
+
+#------------------------------------------------------------------------------#
+# Execute storage engine specific tests
+
+#------------------------------------------------------------------------------#
+# Cleanup
+--source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_alter2_2_myisam.test b/mysql-test/suite/parts/t/partition_alter2_2_myisam.test
new file mode 100644
index 00000000000..2edd6148e3e
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_alter2_2_myisam.test
@@ -0,0 +1,79 @@
+################################################################################
+# t/partition_alter2_2_myisam.test #
+# #
+# Purpose: #
+# Tests around Alter column used in partitioning function #
+# MyISAM branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: mleich #
+# Original Date: 2006-03-05 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+# Please read the README at the end of inc/partition.pre before changing
+# any of the variables.
+#
+
+#------------------------------------------------------------------------------#
+# General not engine specific settings and requirements
+
+##### Options, for debugging support #####
+let $debug= 0;
+let $with_partitioning= 1;
+
+##### Option, for displaying files #####
+let $ls= 1;
+
+##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
+# on partioned tables
+SET @max_row = 20;
+
+##### Execute more tests #####
+let $more_trigger_tests= 0;
+let $more_pk_ui_tests= 0;
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+let $engine= 'MyISAM';
+
+##### Execute the test of "table" files
+# MyISAM has files per PK, UI, ...
+let $do_file_tests= 1;
+
+##### Execute PRIMARY KEY tests #####
+# AFAIK MyISAM treats PRIMARY KEYs like UNIQUE INDEXes
+let $do_pk_tests= 0;
+
+##### Assign a big number smaller than the maximum value for partitions #####
+# and smaller than the maximum value of SIGNED INTEGER
+let $MAX_VALUE= (2147483646);
+
+# Generate the prerequisites ($variables, @variables, tables) needed
+--source suite/parts/inc/partition.pre
+
+##### Workarounds for known open engine specific bugs
+# none
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_alter2_2.inc
+
+#------------------------------------------------------------------------------#
+# Execute storage engine specific tests
+
+#------------------------------------------------------------------------------#
+# Cleanup
+--source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_archive.test b/mysql-test/suite/parts/t/partition_auto_increment_archive.test
new file mode 100644
index 00000000000..fb09557204f
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_archive.test
@@ -0,0 +1,40 @@
+################################################################################
+# t/partition_auto_increment_archive.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# Archive branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-09-02 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+--source include/have_archive.inc
+# Archve does not support delete
+let $skip_delete= 1;
+let $skip_truncate= 1;
+let $skip_update= 1;
+let $only_ai_pk= 1;
+
+##### Storage engine to be tested
+let $engine= 'Archive';
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_blackhole.test b/mysql-test/suite/parts/t/partition_auto_increment_blackhole.test
new file mode 100644
index 00000000000..64cd96c6173
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_blackhole.test
@@ -0,0 +1,35 @@
+################################################################################
+# t/partition_auto_increment_blackhole.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# Blackhole branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-09-02 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+--source include/have_blackhole.inc
+
+##### Storage engine to be tested
+let $engine= 'Blackhole';
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_innodb.test b/mysql-test/suite/parts/t/partition_auto_increment_innodb.test
new file mode 100644
index 00000000000..4e968d8758f
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_innodb.test
@@ -0,0 +1,35 @@
+################################################################################
+# t/partition_auto_increment_innodb.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# InnoDB branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-02-12 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+let $engine= 'InnoDB';
+--source include/have_innodb.inc
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_maria.test b/mysql-test/suite/parts/t/partition_auto_increment_maria.test
new file mode 100644
index 00000000000..5f1515ec929
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_maria.test
@@ -0,0 +1,35 @@
+################################################################################
+# t/partition_auto_increment_maria.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# MARIA branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-02-12 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MARIA SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+--source include/have_maria.inc
+let $engine= 'MARIA';
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_memory.test b/mysql-test/suite/parts/t/partition_auto_increment_memory.test
new file mode 100644
index 00000000000..585a75cc9b5
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_memory.test
@@ -0,0 +1,34 @@
+################################################################################
+# t/partition_auto_increment_memory.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# Memory branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-02-12 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+let $engine= 'Memory';
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_myisam.test b/mysql-test/suite/parts/t/partition_auto_increment_myisam.test
new file mode 100644
index 00000000000..2e3f49d5cb6
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_myisam.test
@@ -0,0 +1,34 @@
+################################################################################
+# t/partition_auto_increment_myisam.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# MyISAM branch #
+# #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-02-12 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+
+##### Storage engine to be tested
+let $engine= 'MyISAM';
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_ndb.test b/mysql-test/suite/parts/t/partition_auto_increment_ndb.test
new file mode 100644
index 00000000000..7aa3839762d
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_auto_increment_ndb.test
@@ -0,0 +1,41 @@
+################################################################################
+# t/partition_auto_increment_ndb.test #
+# #
+# Purpose: #
+# Tests around auto increment column #
+# NDB branch #
+# #
+# Note: NDB behavior for auto_increment on secondary column in #
+# multi-column-index is NOT like MyISAM, instead it uses the same #
+# behavior as if it was the primary column. #
+#------------------------------------------------------------------------------#
+# Original Author: MattiasJ #
+# Original Date: 2008-09-02 #
+# Change Author: #
+# Change Date: #
+# Change: #
+################################################################################
+
+#
+# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
+# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
+# THE SOURCED FILES ONLY.
+#
+
+# The server must support partitioning.
+--source include/have_partition.inc
+
+#------------------------------------------------------------------------------#
+# Engine specific settings and requirements
+--source include/have_ndb.inc
+
+##### Storage engine to be tested
+let $engine= 'NDB';
+connection default;
+#enable hash partitioning
+SET new=on;
+
+#------------------------------------------------------------------------------#
+# Execute the tests to be applied to all storage engines
+--source suite/parts/inc/partition_auto_increment.inc
+
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test
index 460e08bc124..5b4f2568d46 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test
@@ -31,7 +31,6 @@
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
-let $have_bug37719= 1;
##### Storage engine to be tested
--source include/have_archive.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
new file mode 100644
index 00000000000..27094e761b0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -0,0 +1,100 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t1 (a INT, b INT, c INT);
+CREATE TABLE t2 (a INT, b INT, c INT);
+ALTER TABLE t1 ENGINE=BLACKHOLE;
+INSERT INTO t2 VALUES (1,9,1), (2,9,2), (3,9,3), (4,9,4);
+[on master]
+INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4);
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 1;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+DELETE FROM t1 WHERE a % 2 = 0 AND b = 1;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+INSERT INTO t1 SELECT * FROM t2;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+INSERT INTO t2 SELECT * FROM t1;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b);
+[on master]
+INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4);
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 2;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+DELETE FROM t1 WHERE a % 2 = 0 AND b = 2;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a);
+[on master]
+INSERT INTO t1 VALUES (1,3,1),(2,3,2),(3,3,3),(4,3,4);
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 3;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
+[on master]
+DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
+[on slave]
+# Expect 0
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+>>> Something was written to binary log <<<
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
index f0f41c02a84..e57daad3342 100644
--- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
@@ -885,7 +885,9 @@ t16 CREATE TABLE `t16` (
`c4` blob,
`c5` char(5) DEFAULT NULL,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
*** Show table on Slave ****
SHOW CREATE TABLE t16;
Table Create Table
@@ -898,7 +900,9 @@ t16 CREATE TABLE `t16` (
`c6` int(11) DEFAULT '1',
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
*** DROP TABLE t16 ***
DROP TABLE t16;
*** Alter Master End ***
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
index da8151262d1..6696ddc7789 100644
--- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
@@ -885,7 +885,9 @@ t16 CREATE TABLE `t16` (
`c4` blob,
`c5` char(5) DEFAULT NULL,
PRIMARY KEY (`c1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
*** Show table on Slave ****
SHOW CREATE TABLE t16;
Table Create Table
@@ -898,7 +900,9 @@ t16 CREATE TABLE `t16` (
`c6` int(11) DEFAULT '1',
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`c1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
*** DROP TABLE t16 ***
DROP TABLE t16;
*** Alter Master End ***
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
index aadeccdb632..6ad22c368b4 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -113,7 +113,21 @@ Create Table CREATE TABLE `byrange_tbl` (
`fkid` mediumint(9) DEFAULT NULL,
`filler` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB, PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB, PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+SUBPARTITION BY HASH (id)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB,
+ PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB,
+ PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB,
+ PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB,
+ PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB,
+ PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB,
+ PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB,
+ PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB,
+ PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
SELECT count(*) "Slave norm" FROM test.regular_tbl;
Slave norm 500
SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index 76e405c68de..e171e247b6c 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
@@ -398,8 +398,6 @@ f1()
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
INSERT INTO t1 VALUES (NULL, f2());
-INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)),
-(NULL, @@LAST_INSERT_ID);
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
UPDATE t1 SET j= -1 WHERE i IS NULL;
INSERT INTO t1 (i) VALUES (NULL);
@@ -422,20 +420,17 @@ i j
11 3
12 3
13 8
-14 13
-15 5
-16 13
-17 -1
-18 14
-19 0
-20 0
+14 -1
+15 13
+16 0
+17 0
SELECT * FROM t2 ORDER BY i;
i
2
3
5
6
-19
+16
SELECT * FROM t1;
i j
1 -1
@@ -451,20 +446,17 @@ i j
11 3
12 3
13 8
-14 13
-15 5
-16 13
-17 -1
-18 14
-19 0
-20 0
+14 -1
+15 13
+16 0
+17 0
SELECT * FROM t2;
i
2
3
5
6
-19
+16
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP FUNCTION f2;
diff --git a/mysql-test/suite/rpl/r/rpl_redirect.result b/mysql-test/suite/rpl/r/rpl_redirect.result
deleted file mode 100644
index 39a7cb3ac3b..00000000000
--- a/mysql-test/suite/rpl/r/rpl_redirect.result
+++ /dev/null
@@ -1,40 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-SHOW SLAVE STATUS;
-SHOW SLAVE HOSTS;
-Server_id Host Port Rpl_recovery_rank Master_id
-2 127.0.0.1 SLAVE_PORT 2 1
-create table t1 ( n int);
-insert into t1 values (1),(2),(3),(4);
-insert into t1 values(5);
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-5
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-5
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index d9d96cf7eda..77148fc688c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -527,3 +527,115 @@ ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
Comparing tables master:test.t1 and slave:test.t1
drop table t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='MYISAM' ;
+INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
+CREATE TABLE t2 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='MYISAM' ;
+INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
+UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+*** results: t2 must be consistent ****
+Comparing tables master:test.t2 and master:test.t2
+DROP TABLE t1, t2;
+EOF OF TESTS
+CREATE TABLE t1 (a int) ENGINE='MYISAM' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 2 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 5 WHERE a = 9;
+DELETE FROM t1 WHERE a < 6;
+UPDATE t1 SET a = 9 WHERE a < 3;
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a < 4;
+UPDATE t1 SET a = 8 WHERE a < 5;
+Comparing tables master:test.t1 and slave:test.t1
+drop table t1;
+CREATE TABLE t1 (a bit) ENGINE='MYISAM' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+DELETE FROM t1 WHERE a < 2 LIMIT 4;
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 9 );
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 8 );
+UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
+INSERT INTO t1 ( a ) VALUES ( 4 );
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
+DELETE FROM t1 WHERE a = 4 LIMIT 7;
+UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
+UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
+DELETE FROM t1 WHERE a < 0 LIMIT 5;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
+DELETE FROM t1 WHERE a < 8 LIMIT 8;
+INSERT INTO t1 ( a ) VALUES ( 6 );
+DELETE FROM t1 WHERE a < 6 LIMIT 7;
+UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+INSERT INTO t1 ( a ) VALUES ( 6 );
+UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
+DELETE FROM t1 WHERE a = 2 LIMIT 9;
+DELETE FROM t1 WHERE a = 1 LIMIT 4;
+UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
+INSERT INTO t1 ( a ) VALUES ( 0 );
+DELETE FROM t1 WHERE a < 3 LIMIT 0;
+UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
+INSERT INTO t1 ( a ) VALUES ( 1 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+Comparing tables master:test.t1 and slave:test.t1
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 72c94ceb525..8d071d503bc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -527,3 +527,115 @@ ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
Comparing tables master:test.t1 and slave:test.t1
drop table t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='INNODB' ;
+INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
+CREATE TABLE t2 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='INNODB' ;
+INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
+UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+*** results: t2 must be consistent ****
+Comparing tables master:test.t2 and master:test.t2
+DROP TABLE t1, t2;
+EOF OF TESTS
+CREATE TABLE t1 (a int) ENGINE='INNODB' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 2 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 5 WHERE a = 9;
+DELETE FROM t1 WHERE a < 6;
+UPDATE t1 SET a = 9 WHERE a < 3;
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a < 4;
+UPDATE t1 SET a = 8 WHERE a < 5;
+Comparing tables master:test.t1 and slave:test.t1
+drop table t1;
+CREATE TABLE t1 (a bit) ENGINE='INNODB' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+DELETE FROM t1 WHERE a < 2 LIMIT 4;
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 9 );
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 8 );
+UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
+INSERT INTO t1 ( a ) VALUES ( 4 );
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
+DELETE FROM t1 WHERE a = 4 LIMIT 7;
+UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
+UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
+DELETE FROM t1 WHERE a < 0 LIMIT 5;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
+DELETE FROM t1 WHERE a < 8 LIMIT 8;
+INSERT INTO t1 ( a ) VALUES ( 6 );
+DELETE FROM t1 WHERE a < 6 LIMIT 7;
+UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+INSERT INTO t1 ( a ) VALUES ( 6 );
+UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
+DELETE FROM t1 WHERE a = 2 LIMIT 9;
+DELETE FROM t1 WHERE a = 1 LIMIT 4;
+UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
+INSERT INTO t1 ( a ) VALUES ( 0 );
+DELETE FROM t1 WHERE a < 3 LIMIT 0;
+UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
+INSERT INTO t1 ( a ) VALUES ( 1 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+Comparing tables master:test.t1 and slave:test.t1
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index dedd5d044e0..3443e704031 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
@@ -34,7 +34,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- On slave --
SHOW CREATE TABLE t1;
Table Create Table
@@ -48,7 +55,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -101,7 +115,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -115,7 +136,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -177,7 +205,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -191,7 +223,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -244,7 +280,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -258,7 +298,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -318,7 +362,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -332,7 +378,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -385,7 +433,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -399,7 +449,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -460,7 +512,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -475,7 +529,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -529,7 +585,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -544,7 +602,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -598,7 +658,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- On slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -613,7 +675,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index c4cf8353bca..ad659c37b7f 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -430,4 +430,25 @@ a
1
2
DROP TABLE t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE DATABASE mysqltest1;
+CREATE TABLE mysqltest1.without_select (f1 BIGINT);
+CREATE TABLE mysqltest1.with_select AS SELECT 1 AS f1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # CREATE DATABASE mysqltest1
+master-bin.000001 # Query # # use `test`; CREATE TABLE mysqltest1.without_select (f1 BIGINT)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; CREATE TABLE `mysqltest1`.`with_select` (
+ `f1` int(1) NOT NULL DEFAULT '0'
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.with_select)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
+DROP DATABASE mysqltest1;
end of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_row_stop_middle.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle.result
deleted file mode 100644
index 46ca5748174..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_stop_middle.result
+++ /dev/null
@@ -1,26 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-create table t1 (a int not null auto_increment primary key, b int, key(b));
-stop slave;
-INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-start slave;
-stop slave;
-drop table t1;
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 1255f9427b0..3ca4f86cf64 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -193,7 +193,7 @@ end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
set global log_bin_trust_routine_creators=1;
Warnings:
-Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
set global log_bin_trust_function_creators=1;
@@ -526,7 +526,7 @@ master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(col VARCHAR(10))
master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
INSERT INTO t1 VALUES(arg)
-master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
+master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1
master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SET @a = 1
@@ -869,7 +869,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
INSERT INTO t1 VALUES(arg)
/*!*/;
SET TIMESTAMP=t/*!*/;
-INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
+INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
/*!*/;
SET TIMESTAMP=t/*!*/;
DROP PROCEDURE p1
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 03d2ca660dc..d8fea78ecb4 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -24,6 +24,9 @@ drop table if exists t1,t2;
create table t1(f int);
create table t2(f int);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+10
create temporary table t3(f int);
insert into t3 select * from t1 where f<6;
create temporary table t3(f int);
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index a8c83d58884..8cae44a3607 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,7 +10,3 @@
#
##############################################################################
-rpl_redirect : Failure is sporadic and and the test is superfluous (mats)
-rpl_innodb_bug28430 : Failure on Solaris Bug #36793
-rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild
-rpl_flushlog_loop : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test
new file mode 100644
index 00000000000..e8dfbd51552
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_blackhole.test
@@ -0,0 +1,80 @@
+# PURPOSE. Test that blackhole works with replication in all three
+# modes: STATEMENT, MIXED, and ROW.
+#
+# METHOD. We start by creating a table on the master and then change
+# the engine to use blackhole on the slave.
+#
+# After insert/update/delete of one or more rows, the test the
+# proceeds to check that replication is running after replicating an
+# change, that the blackhole engine does not contain anything (which
+# is just a check that the correct engine is used), and that something
+# is written to the binary log.
+#
+# Whe check INSERT, UPDATE, and DELETE statement for tables with no
+# key (forcing a range search on the slave), primary keys (using a
+# primary key lookup), and index/key with multiple matches (forcing an
+# index search).
+
+source include/master-slave.inc;
+source include/have_blackhole.inc;
+
+# We start with no primary key
+CREATE TABLE t1 (a INT, b INT, c INT);
+CREATE TABLE t2 (a INT, b INT, c INT);
+
+sync_slave_with_master;
+ALTER TABLE t1 ENGINE=BLACKHOLE;
+
+connection master;
+INSERT INTO t2 VALUES (1,9,1), (2,9,2), (3,9,3), (4,9,4);
+sync_slave_with_master;
+
+# Test insert, no primary key
+let $statement = INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4);
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test update, no primary key
+let $statement = UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 1;
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test delete, no primary key
+let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 1;
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test INSERT-SELECT into Blackhole, no primary key
+let $statement = INSERT INTO t1 SELECT * FROM t2;
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test INSERT-SELECT from Blackhole, no primary key
+let $statement = INSERT INTO t2 SELECT * FROM t1;
+source extra/rpl_tests/rpl_blackhole.test;
+
+connection master;
+ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b);
+
+# Test insert, primary key
+let $statement = INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4);
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test update, primary key
+let $statement = UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 2;
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test delete, primary key
+let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 2;
+source extra/rpl_tests/rpl_blackhole.test;
+
+connection master;
+ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a);
+
+# Test insert, key
+let $statement = INSERT INTO t1 VALUES (1,3,1),(2,3,2),(3,3,3),(4,3,4);
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test update, key
+let $statement = UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 3;
+source extra/rpl_tests/rpl_blackhole.test;
+
+# Test delete, key
+let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
+source extra/rpl_tests/rpl_blackhole.test;
diff --git a/mysql-test/suite/rpl/t/rpl_redirect.test b/mysql-test/suite/rpl/t/rpl_redirect.test
deleted file mode 100644
index 1c6f31a030e..00000000000
--- a/mysql-test/suite/rpl/t/rpl_redirect.test
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Test of automatic redirection of queries to master/slave.
-#
-
-source include/master-slave.inc;
-# We disable this for now as PS doesn't handle redirection
---disable_ps_protocol
-
-#first, make sure the slave has had enough time to register
-save_master_pos;
-connection slave;
-sync_with_master;
-
-#discover slaves
-connection master;
-source include/show_slave_status.inc;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-SHOW SLAVE HOSTS;
-rpl_probe;
-
-#turn on master/slave query direction auto-magic
-enable_rpl_parse;
-create table t1 ( n int);
-insert into t1 values (1),(2),(3),(4);
-disable_rpl_parse;
-save_master_pos;
-connection slave;
-sync_with_master;
-insert into t1 values(5);
-connection master;
-enable_rpl_parse;
-# The first of the queries will be sent to the slave, the second to the master.
-SELECT * FROM t1 ORDER BY n;
-SELECT * FROM t1 ORDER BY n;
-disable_rpl_parse;
-SELECT * FROM t1 ORDER BY n;
-connection slave;
-SELECT * FROM t1 ORDER BY n;
-
-# Cleanup
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index e5cdfa4341a..3fb5aa8e1f2 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -259,5 +259,22 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
+#
+# BUG#34707: Row based replication: slave creates table within wrong database
+#
+
+source include/master-slave-reset.inc;
+
+connection master;
+CREATE DATABASE mysqltest1;
+
+CREATE TABLE mysqltest1.without_select (f1 BIGINT);
+CREATE TABLE mysqltest1.with_select AS SELECT 1 AS f1;
+source include/show_binlog_events.inc;
+sync_slave_with_master;
+
+connection master;
+DROP DATABASE mysqltest1;
+sync_slave_with_master;
--echo end of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test
deleted file mode 100644
index bc169bebfcd..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle.test
+++ /dev/null
@@ -1,45 +0,0 @@
-# Test for BUG#11729: see if, when STOP SLAVE occurs while the slave
-# SQL thread has processed a Table_map_log_event but has not processed
-# the last Rows_log_event associated to it, the slave thread does not
-# forget to close its tables.
-
-# Can be run with statement-based but no interest (and long test)
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-connection master;
-create table t1 (a int not null auto_increment primary key, b int, key(b));
-sync_slave_with_master;
-stop slave;
-connection master;
-INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-INSERT INTO t1 (a) SELECT null FROM t1;
-
-connection slave;
-start slave;
-
-# hope one second is not enough for slave to reach the last
-# Rows_log_event, so that test actually tests something.
-
-let $wait_condition= SELECT COUNT(*) >= 10 FROM t1;
---source include/wait_condition.inc
-stop slave;
-
-# see if slave hangs on DROP TABLE
-
-drop table t1;
-
-connection master; # cleanup
-drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index 51b38ed4837..a40d1cbb5c5 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
@@ -56,6 +56,8 @@ drop table if exists t1,t2;
create table t1(f int);
create table t2(f int);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+# Auxiliary select (We want that all rows are in the table)
+SELECT COUNT(*) FROM t1;
connection con1;
create temporary table t3(f int);
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
index c5e9ff2721b..9857f621bbe 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
@@ -193,7 +193,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave --
SHOW CREATE TABLE t1;
Table Create Table
@@ -207,7 +214,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -265,7 +279,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -281,7 +302,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -349,7 +377,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -363,7 +395,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -421,7 +457,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -437,7 +477,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -502,7 +546,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -515,7 +561,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -573,7 +621,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -589,7 +639,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -655,7 +707,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Show that tables on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -670,7 +724,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -727,7 +783,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -743,7 +801,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -800,7 +860,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -816,7 +878,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
index 824df733fa9..44ee9d01709 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
@@ -193,7 +193,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave --
SHOW CREATE TABLE t1;
Table Create Table
@@ -207,7 +214,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -265,7 +279,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -281,7 +302,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -349,7 +377,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -363,7 +395,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -421,7 +457,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -437,7 +477,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -502,7 +546,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -515,7 +561,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -573,7 +621,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -589,7 +639,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -655,7 +707,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Show that tables on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -670,7 +724,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -727,7 +783,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -743,7 +801,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -800,7 +860,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -816,7 +878,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
index 298f45b5cee..c906f00bd40 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
@@ -52,7 +52,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave --
SHOW CREATE TABLE t1;
Table Create Table
@@ -66,7 +73,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -122,7 +136,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -137,7 +158,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -207,7 +235,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -221,7 +253,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -277,7 +313,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -292,7 +332,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -359,7 +403,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -372,7 +418,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -428,7 +476,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -443,7 +493,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -511,7 +563,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Show that tables on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -526,7 +580,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -583,7 +639,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -599,7 +657,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -656,7 +716,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -672,7 +734,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
index 3ab515806e7..d51599fd18b 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
@@ -885,7 +885,9 @@ t16 CREATE TABLE `t16` (
`c4` blob,
`c5` char(5) DEFAULT NULL,
PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
*** Show table on Slave ****
SHOW CREATE TABLE t16;
Table Create Table
@@ -898,7 +900,9 @@ t16 CREATE TABLE `t16` (
`c6` int(11) DEFAULT '1',
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
*** DROP TABLE t16 ***
DROP TABLE t16;
*** Alter Master End ***
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
index cf4c67f063b..4c96ccf85ee 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
@@ -186,7 +186,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Show table on slave --
SHOW CREATE TABLE t1;
Table Create Table
@@ -200,7 +207,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -258,7 +272,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -274,7 +295,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -342,7 +370,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -356,7 +388,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -414,7 +450,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB,
+ PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB,
+ PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -430,7 +470,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -495,7 +539,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -508,7 +554,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -566,7 +614,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -582,7 +632,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -648,7 +700,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Show that tables on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -663,7 +717,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -720,7 +776,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -736,7 +794,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -793,7 +853,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -809,7 +871,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
index 35fc778a693..eb7d88c812b 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
@@ -186,7 +186,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Show table on slave --
SHOW CREATE TABLE t1;
Table Create Table
@@ -200,7 +207,14 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -258,7 +272,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -274,7 +295,14 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
+ PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
+ PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
+ PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
+ PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
+ PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -342,7 +370,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -356,7 +388,11 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -414,7 +450,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -430,7 +470,11 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
+ PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
+ PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -495,7 +539,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -508,7 +554,9 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -566,7 +614,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -582,7 +632,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH ( YEAR(t))
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -648,7 +700,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Show that tables on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@@ -663,7 +717,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -720,7 +776,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -736,7 +794,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
@@ -793,7 +853,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
@@ -809,7 +871,9 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY ()
+PARTITIONS 4 */
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
"--- Insert into t1 --" as "";
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
index 2538358b4d3..aa9d3132cbb 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
@@ -527,3 +527,115 @@ ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
Comparing tables master:test.t1 and slave:test.t1
drop table t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='NDB' ;
+INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
+CREATE TABLE t2 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='NDB' ;
+INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
+UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+*** results: t2 must be consistent ****
+Comparing tables master:test.t2 and master:test.t2
+DROP TABLE t1, t2;
+EOF OF TESTS
+CREATE TABLE t1 (a int) ENGINE='NDB' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 2 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 5 WHERE a = 9;
+DELETE FROM t1 WHERE a < 6;
+UPDATE t1 SET a = 9 WHERE a < 3;
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a < 4;
+UPDATE t1 SET a = 8 WHERE a < 5;
+Comparing tables master:test.t1 and slave:test.t1
+drop table t1;
+CREATE TABLE t1 (a bit) ENGINE='NDB' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+DELETE FROM t1 WHERE a < 2 LIMIT 4;
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 9 );
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 8 );
+UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
+INSERT INTO t1 ( a ) VALUES ( 4 );
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
+DELETE FROM t1 WHERE a = 4 LIMIT 7;
+UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
+UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
+DELETE FROM t1 WHERE a < 0 LIMIT 5;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
+DELETE FROM t1 WHERE a < 8 LIMIT 8;
+INSERT INTO t1 ( a ) VALUES ( 6 );
+DELETE FROM t1 WHERE a < 6 LIMIT 7;
+UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+INSERT INTO t1 ( a ) VALUES ( 6 );
+UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
+DELETE FROM t1 WHERE a = 2 LIMIT 9;
+DELETE FROM t1 WHERE a = 1 LIMIT 4;
+UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
+INSERT INTO t1 ( a ) VALUES ( 0 );
+DELETE FROM t1 WHERE a < 3 LIMIT 0;
+UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
+INSERT INTO t1 ( a ) VALUES ( 1 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+Comparing tables master:test.t1 and slave:test.t1
+drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
index 3446003bf5d..549227db61a 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
@@ -1,6 +1,11 @@
# Same test as rpl_truncate_7ndb.test, but with mixed mode
# This is marked with 'big_test' just because the rpl_truncate_7ndb test is
# so slow...
+
+# Last Change: 2008-09-03
+# Change Author: pcrews
+# Change: Moved test to rpl_ndb suite, updated location of --source .test file
+
--source include/have_binlog_format_mixed.inc
--source include/big_test.inc
--source suite/rpl_ndb/t/rpl_truncate_7ndb.test
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 40896c5faf9..a5460c6defd 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -947,4 +947,44 @@ ALTER TABLE t1 CHANGE d c varchar(10);
--disable_info
DROP TABLE t1;
+#
+# Bug#39372 "Smart" ALTER TABLE not so smart after all.
+#
+create table t1(f1 int not null, f2 int not null, key (f1), key (f2));
+let $count= 50;
+--disable_query_log
+while ($count)
+{
+ EVAL insert into t1 values (1,1),(1,1),(1,1),(1,1),(1,1);
+ EVAL insert into t1 values (2,2),(2,2),(2,2),(2,2),(2,2);
+ dec $count ;
+}
+--enable_query_log
+
+select index_length into @unpaked_keys_size from
+information_schema.tables where table_name='t1';
+alter table t1 pack_keys=1;
+select index_length into @paked_keys_size from
+information_schema.tables where table_name='t1';
+select (@unpaked_keys_size > @paked_keys_size);
+
+select max_data_length into @orig_max_data_length from
+information_schema.tables where table_name='t1';
+alter table t1 max_rows=100;
+select max_data_length into @changed_max_data_length from
+information_schema.tables where table_name='t1';
+select (@orig_max_data_length > @changed_max_data_length);
+
+drop table t1;
+
+#
+# Bug #23113: Different behavior on altering ENUM fields between 5.0 and 5.1
+#
+CREATE TABLE t1(a INT AUTO_INCREMENT PRIMARY KEY,
+ b ENUM('a', 'b', 'c') NOT NULL);
+INSERT INTO t1 (b) VALUES ('a'), ('c'), ('b'), ('b'), ('a');
+ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL;
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index ff92c743960..47458c1f054 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -314,5 +314,15 @@ insert into t1 values(null,0,0,null);
# this will delete two rows
replace into t1 values(null,1,0,null);
select last_insert_id();
+drop table t1;
+# Test of REPLACE when it does a INSERT+DELETE for all the conflicting rows
+# (i.e.) when there are three rows conflicting in unique key columns with
+# a row that is being inserted, all the three rows will be deleted and then
+# the new rows will be inserted.
+create table t1 (a int primary key auto_increment, b int, c int, e int, d timestamp default current_timestamp, unique(b),unique(c),unique(e));
+insert into t1 values(null,1,1,1,now());
+insert into t1 values(null,0,0,0,null);
+replace into t1 values(null,1,0,2,null);
+select last_insert_id();
drop table t1;
diff --git a/mysql-test/t/binlog_format_basic.test b/mysql-test/t/binlog_format_basic.test
index e9dfade8f56..819ad047c1b 100644
--- a/mysql-test/t/binlog_format_basic.test
+++ b/mysql-test/t/binlog_format_basic.test
@@ -22,6 +22,13 @@
# #
###############################################################################
+###################################################################
+# BUG#39812: Make statement replication default for 5.1 (to match 5.0)
+# We just verify that the default binlog_format is STATEMENT in 5.1.
+# In 6.0, it should be MIXED.
+###################################################################
+SELECT @@GLOBAL.binlog_format;
+
--echo '#---------------------BS_STVARS_002_01----------------------#'
####################################################################
# Displaying default value #
diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test
index 8863ed825c2..103244eb2f7 100644
--- a/mysql-test/t/compare.test
+++ b/mysql-test/t/compare.test
@@ -76,4 +76,13 @@ FROM t2 ORDER BY a;
DROP TABLE t1,t2;
+#
+# Bug #39353: Multiple conditions on timestamp column crashes server
+#
+
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
+SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 1b8500e15dc..bcbd507bcdd 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1175,6 +1175,11 @@ CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
SHOW INDEX FROM t1;
DROP TABLE t1;
+#
+# Bug#35924 DEFINER should be stored 'quoted' in I_S
+#
+--error ER_UNKNOWN_ERROR
+create user mysqltest_1@'test@test';
#
# Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index 0ed21091110..5a8a13f2bad 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -79,7 +79,8 @@ delete from t1;
--eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt'));
load data infile 't1.txt' into table t1;
select hex(a) from t1;
---exec rm $MYSQLTEST_VARDIR/master-data/test/t1.txt
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.txt
+
drop table t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index db609777c8d..cb371bc0ca6 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -678,6 +678,17 @@ select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
drop table t1;
+#
+# Bug#35720 ucs2 + pad_char_to_full_length = failure
+#
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET UCS2);
+INSERT INTO t1 VALUES ('a');
+SET @@sql_mode=pad_char_to_full_length;
+SELECT HEX(s1) FROM t1;
+SET @@sql_mode=default;
+SELECT HEX(s1) FROM t1;
+DROP TABLE t1;
+
set collation_connection=ucs2_general_ci;
--source include/ctype_regex.inc
set names latin1;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index ada7cb3aa97..8c89d01f0f8 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -11,7 +11,5 @@
##############################################################################
federated_transactions : Bug#29523 Transactions do not work
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
-thread_cache_size_func : Bug#36733 main.thread_cache_size_func fails randomly
log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
-
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 559dde44b81..5be8d911881 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -438,72 +438,71 @@ EXPLAIN SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
DROP TABLE t1;
-# The test case for bug#20836 should be re-enabled when bug#16861 is resolved
-# The results for the test should be the same as in 4.1.
-#
+
#Bug #20836: Selecting into variables results in wrong results being returned
-#
-#--disable_warnings
-#DROP TABLE IF EXISTS t1;
-#--enable_warnings
-#
-#CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
-#default NULL);
-#
-#INSERT INTO t1 VALUES (1,1,'ORANGE');
-#INSERT INTO t1 VALUES (2,2,'APPLE');
-#INSERT INTO t1 VALUES (3,2,'APPLE');
-#INSERT INTO t1 VALUES (4,3,'PEAR');
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
-#'APPLE';
-#SELECT @v1, @v2;
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
-#fruit_name HAVING fruit_name = 'APPLE';
-#SELECT @v3, @v4;
-#
-#SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
-#fruit_name = 'APPLE';
-#SELECT @v5, @v6, @v7, @v8;
-#
-#SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
-#WHERE fruit_name = 'APPLE';
-#SELECT @v5, @v6, @v7, @v8, @v9, @v10;
-#
-#SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
-#@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
-#SELECT @v11, @v12, @v13, @v14;
-#
-#SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
-#SELECT @v15, @v16;
-#
-#SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
-#'APPLE';
-#SELECT @v17, @v18;
-#
-#--disable_warnings
-#DROP TABLE IF EXISTS t2;
-#--enable_warnings
-#
-#CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
-#default NULL);
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
-#'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-#LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
-#--exec rm $MYSQL_TEST_DIR/var/tmp/data1.tmp
-#
-#SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
-#'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-#LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
-#--exec rm $MYSQL_TEST_DIR/var/tmp/data2.tmp
-#
-#SELECT @v19, @v20;
-#SELECT * FROM t2;
-#
-#DROP TABLE t1;
-#DROP TABLE t2;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+
+INSERT INTO t1 VALUES (1,1,'ORANGE');
+INSERT INTO t1 VALUES (2,2,'APPLE');
+INSERT INTO t1 VALUES (3,2,'APPLE');
+INSERT INTO t1 VALUES (4,3,'PEAR');
+
+SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
+'APPLE';
+SELECT @v1, @v2;
+
+SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
+fruit_name HAVING fruit_name = 'APPLE';
+SELECT @v3, @v4;
+
+SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
+fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8;
+
+SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
+WHERE fruit_name = 'APPLE';
+SELECT @v5, @v6, @v7, @v8, @v9, @v10;
+
+SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
+@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v11, @v12, @v13, @v14;
+
+SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
+SELECT @v15, @v16;
+
+SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
+'APPLE';
+SELECT @v17, @v18;
+
+--disable_warnings
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
+default NULL);
+
+SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
+'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp
+
+SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
+'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
+LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
+--remove_file $MYSQLTEST_VARDIR/tmp/data2.tmp
+
+SELECT @v19, @v20;
+SELECT * FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
#
# Bug #15881: cast problems
diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test
index 58a6fffe6f5..a50255e9f8b 100644
--- a/mysql-test/t/events_2.test
+++ b/mysql-test/t/events_2.test
@@ -411,6 +411,108 @@ create event
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
on schedule every 2 year do select 1;
+#
+# Bug#35981: ALTER EVENT causes the server to change the PRESERVE option.
+#
+
+create event event_35981 on schedule every 6 month on completion preserve
+disable
+do
+ select 1;
+
+echo The following SELECTs should all give 1;
+
+# show current ON_COMPLETION
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+ on_completion = 'PRESERVE';
+
+# show ON_COMPLETION remains "PRESERVE" when not given in ALTER EVENT
+alter event event_35981 enable;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+ on_completion = 'PRESERVE';
+
+# show we can change ON_COMPLETION
+alter event event_35981 on completion not preserve;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+ on_completion = 'NOT PRESERVE';
+
+# show ON_COMPLETION remains "NOT PRESERVE" when not given in ALTER EVENT
+alter event event_35981 disable;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+ on_completion = 'NOT PRESERVE';
+
+# show we can change ON_COMPLETION
+alter event event_35981 on completion preserve;
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+ on_completion = 'PRESERVE';
+
+
+drop event event_35981;
+
+create event event_35981 on schedule every 6 month disable
+do
+ select 1;
+
+# show that the defaults for CREATE EVENT are still correct (NOT PRESERVE)
+select count(*) from information_schema.events
+where event_schema = database() and event_name = 'event_35981' and
+ on_completion = 'NOT PRESERVE';
+
+drop event event_35981;
+
+
+# show that backdating doesn't break
+
+create event event_35981 on schedule every 1 hour starts current_timestamp
+ on completion not preserve
+do
+ select 1;
+
+# should fail thanks to above's NOT PRESERVE
+--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00';
+
+drop event event_35981;
+
+create event event_35981 on schedule every 1 hour starts current_timestamp
+ on completion not preserve
+do
+ select 1;
+
+# succeed with warning
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00' on completion preserve;
+
+drop event event_35981;
+
+
+
+create event event_35981 on schedule every 1 hour starts current_timestamp
+ on completion preserve
+do
+ select 1;
+
+# this should succeed thanks to above PRESERVE! give a warning though.
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00';
+
+# this should fail, as the event would have passed already
+--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00' on completion not preserve;
+
+# should succeed giving a warning
+alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
+ ends '1999-01-02 00:00:00' on completion preserve;
+
+drop event event_35981;
+
#
# End of tests
#
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index b3b2f37e36f..e86734c167c 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -1,3 +1,42 @@
+#### t/events_bugs.test
+#
+# Last change:
+# 2008-10-16 mleich
+# - Fix for
+# Bug#39848 events_bugs fails sporadically on pushbuild
+# (missing rows in table event_log)
+# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes
+# in I_S.PROCESSLIST)
+# Bug#39978 main.events_bugs does not clean up
+# Bug#39569 events_bugs fails sporadically on pushbuild (should have
+# failed with errno 1539)
+# - Minor improvements of formatting
+#
+#
+# Outcome of some experiments (mleich):
+# 1. SET GLOBAL event_scheduler = 'ON';
+# Immediate observation of the processlist.
+# Effects:
+# 1. There is no guarantee to find immediate the user 'event_scheduler'
+# within information_schema.processlist.
+# 2. Some states of the user 'event_scheduler' found in PROCESSLIST:
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL
+# event_scheduler localhost NULL Daemon 0 Initialized NULL
+# 2. SET GLOBAL event_scheduler = 'OFF';
+# Immediate observation of the processlist.
+# Effects:
+# 1. I never found the user 'event_scheduler' within the processlist.
+# 2. Events just during execution could be found within the processlist
+# = It does not look like "SET GLOBAL event_scheduler = 'OFF'" stops them.
+# 3. An event gets executed
+# USER evtest1 (Definer of event)
+# DB events_test (DB during time of event creation)
+# COMMAND Connect
+# STATE NULL
+# INFO SET @evname = 'ev_sched_1823' (Part of the event code)
+#
+
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
@@ -105,14 +144,39 @@ begin
end|
delimiter ;|
+# The default session has the user lock.
+# We wait till one event runs and hangs when trying to get the user lock.
let $wait_condition=
- select count(*) = 1 from information_schema.processlist
+ select count(*) > 0 from information_schema.processlist
where info = 'select get_lock(\'test_bug16407\', 60)';
--source include/wait_condition.inc
--echo "Now if everything is fine the event has compiled and is locked"
-select /*1*/ user, host, db, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
+# Expect to see one session in events_test waiting for the user lock.
+select /*1*/ user, host, db, info from information_schema.processlist
+where info = 'select get_lock(\'test_bug16407\', 60)';
select release_lock('test_bug16407');
+# Try to avoid
+# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes in I_S.PROCESSLIST)
+# which is most probably caused by
+# Bug#32782 User lock hash fails to find lock
+# "various issues related to missing or incorrect return results
+# from release_lock()."
+# Therefore we check here if the event executing session disappeared or
+# we waited >= 5 seconds for this to happen.
+let $wait_timeout= 5;
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where info = 'select get_lock(\'test_bug16407\', 60)';
+--source include/wait_condition.inc
+if (!`$wait_condition`)
+{
+ --echo ERROR: There must be no session with info = 'select get_lock('test_bug16407', 60) within the processlist.
+ --echo We probably hit Bug#32782 User lock hash fails to find lock
+ eval select * from information_schema.processlist;
+ --echo Abort
+ exit;
+}
set global event_scheduler= off;
@@ -164,17 +228,27 @@ let $wait_condition=
where info = 'select get_lock(\'ee_16407_2\', 60)';
--source include/wait_condition.inc
-select /*2*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*2*/ user, host, db, info from information_schema.processlist
+where info = 'select get_lock(\'ee_16407_2\', 60)';
select release_lock('ee_16407_2');
+# Try to avoid
+# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes in I_S.PROCESSLIST)
+# which is most probably caused by
+# Bug#32782 User lock hash fails to find lock
+# "various issues related to missing or incorrect return results
+# from release_lock()."
+# Therefore we check here if the event executing sessions disappeared or
+# we waited >= 5 seconds for this to happen.
+let $wait_timeout= 5;
let $wait_condition=
- select count(*) = 1 and user = 'event_scheduler' and info is null
+ select count(*) = 0
from information_schema.processlist
- where (command!='Daemon' || user='event_scheduler')
- and (info is null or info not like '%processlist%');
+ where info = 'select get_lock(\'ee_16407_2\', 60)';
--source include/wait_condition.inc
-select /*3*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*3*/ user, host, db, info from information_schema.processlist
+where info = 'select get_lock(\'ee_16407_2\', 60)';
set global event_scheduler= off;
select * from events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
@@ -216,7 +290,9 @@ let $wait_condition=
--source include/wait_condition.inc
--echo "Should have 2 locked processes"
-select /*4*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*4*/ user, host, db, info from information_schema.processlist
+where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
+order by info;
select release_lock('ee_16407_5');
let $wait_condition=
@@ -227,7 +303,9 @@ let $wait_condition=
--source include/wait_condition.inc
--echo "Should have 0 processes locked"
-select /*5*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*5*/ user, host, db, info from information_schema.processlist
+where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
+order by info;
select * from events_smode_test order by ev_name, a;
--echo "And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
@@ -239,7 +317,7 @@ set global event_scheduler= off;
drop table events_smode_test;
set sql_mode=@old_sql_mode;
#
-# End - 16407: Events: Changes in sql_mode won't be taken into account
+# End - 16407: Events: Changes in sql_mode won't be taken into account
#
#
@@ -401,39 +479,39 @@ CREATE USER mysqltest_u1@localhost;
GRANT EVENT ON events_test.* TO mysqltest_u1@localhost;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
ALTER DEFINER=mysqltest_u1@localhost EVENT e1 ON SCHEDULE EVERY 1 HOUR;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER() EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
CREATE DEFINER=mysqltest_u1@localhost EVENT e1 ON SCHEDULE EVERY 1 DAY DO
SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
connect (conn1, localhost, mysqltest_u1, , events_test);
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 HOUR;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER() EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
+SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT e1;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -664,21 +742,18 @@ CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
#
-# START - BUG#28924 If I drop the user who is the definer of an active event then server cores
+# START - BUG#28924 If I drop the user who is the definer of an active event
+# then server cores
#
let $engine=MyISAM;
USE test;
SHOW GRANTS FOR CURRENT_USER;
SET GLOBAL event_scheduler = ON;
-eval CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
- ev_nm char(40), ev_cnt int,
- ev_tm timestamp) ENGINE=$engine;
-SET @ev_base_date = 20281224180000;
---disable_warnings
+eval
+CREATE TABLE events_test.event_log
+(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
+ENGINE=$engine;
SET autocommit=0;
-#DROP DATABASE IF EXISTS ev_db_1;
-#CREATE DATABASE ev_db_1;
---enable_warnings
CREATE USER evtest1@localhost;
SET PASSWORD FOR evtest1@localhost = password('ev1');
REVOKE ALL PRIVILEGES, GRANT OPTION FROM evtest1@localhost;
@@ -689,53 +764,70 @@ SHOW GRANTS FOR evtest1@localhost;
--echo connection e1;
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK);
-USE events_test;
-
DELIMITER |;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
- SET AUTOCOMMIT = 0;
- SET @evname = 'ev_sched_1823';
- SET @cnt = 0;
- SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
- IF @cnt < 6 THEN
- INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
- COMMIT;
- END IF;
- SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
- IF @cnt < 6 THEN
- INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
- ROLLBACK;
- END IF;
+ SET AUTOCOMMIT = 0;
+ SET @evname = 'ev_sched_1823';
+ SET @cnt = 0;
+ SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
+ IF @cnt < 6 THEN
+ INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ COMMIT;
+ END IF;
+ SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
+ IF @cnt < 6 THEN
+ INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ ROLLBACK;
+ END IF;
END;|
DELIMITER ;|
-
---sleep 6
+# 1. Show that the new created event is runnable and gets executed within a
+# reasonable time like 4 seconds. Till ~ 2 seconds could pass on a heavy
+# loaded testing box before something gets executed).
+# Detection of execution is via the records inserted by the event.
+--echo Sleep till the first INSERT into events_test.event_log occured
+let $wait_timeout= 4;
+let $wait_condition=
+SELECT COUNT(*) > 0 FROM events_test.event_log;
+--source include/wait_condition.inc
+SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
+#
--echo connection default;
-DROP EVENT ev_sched_1823;
connection default;
DROP USER evtest1@localhost;
-
---sleep 6
-USE test;
---echo =====================================================================================
---sleep 5
-#--disable_result_log
-select id,ev_nm,ev_cnt from event_log order by id;
-#--enable_result_log
-DROP TABLE event_log;
-#DROP DATABASE ev_db_1;
+# 2. If we meet BUG#28924 again than a server crash happens within the next
+# few seconds
+# 3. Check that the event is never executed again
+# It could be that an event execution was running before the DROP USER
+# and all implicite actions belonging to this are completed.
+# Lets assume that ~ 4 seconds waiting are enough for the event
+# scheduler to detect that
+--echo Sleep 4 seconds
+sleep 4;
+SELECT COUNT(*) INTO @row_cnt FROM events_test.event_log;
+# Give the event mechanism ~ 4 seconds to do something wrong
+# (execute the event of the dropped user -> inser rows).
+--echo Sleep 4 seconds
+sleep 4;
+SELECT COUNT(*) > @row_cnt AS "Expect 0" FROM events_test.event_log;
+#
+# Cleanup
+disconnect e1;
+DROP EVENT events_test.ev_sched_1823;
+DROP TABLE events_test.event_log;
SET GLOBAL event_scheduler = OFF;
+
#
# Bug#28641 CREATE EVENT with '2038.01.18 03:00:00' let server crash.
#
SET GLOBAL event_scheduler= ON;
DELIMITER |;
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
- DO BEGIN
- SELECT 1;
- END;|
+DO BEGIN
+ SELECT 1;
+END;|
DELIMITER ;|
SET GLOBAL event_scheduler= OFF;
@@ -868,7 +960,7 @@ SET GLOBAL EVENT_SCHEDULER = ON;
--echo # Waiting for the event scheduler to execute and drop event e1...
-let $wait_timeout = 2;
+let $wait_timeout = 4;
let $wait_condition =
SELECT COUNT(*) = 0
FROM INFORMATION_SCHEMA.EVENTS
@@ -957,7 +1049,7 @@ select name from mysql.event where name = 'p' and sql_mode = @full_mode;
drop event e1;
###########################################################################
-#
+#
# End of tests
#
# !!! KEEP this section AT THE END of this file !!!
@@ -970,5 +1062,8 @@ let $wait_condition=
--source include/wait_condition.inc
DROP DATABASE events_test;
+# Restore the original state (option with no argument in events_bugs-master.opt
+# turns the scheduler on).
+SET GLOBAL event_scheduler = 'ON';
# THIS MUST BE THE LAST LINE in this file.
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index c9ae8aceaf6..3a71fde4421 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -94,4 +94,51 @@ EXPLAIN SELECT 1 FROM
DROP TABLE t2;
DROP TABLE t1;
+#
+# Bug #34773: query with explain extended and derived table / other table
+# crashes server
+#
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+
+EXPLAIN EXTENDED SELECT 1
+ FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1;
+
+EXPLAIN EXTENDED SELECT 1
+ FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1;
+
+prepare s1 from
+'EXPLAIN EXTENDED SELECT 1
+ FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1';
+execute s1;
+
+prepare s1 from
+'EXPLAIN EXTENDED SELECT 1
+ FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1';
+execute s1;
+execute s1;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug#37870: Usage of uninitialized value caused failed assertion.
+--echo #
+create table t1 (dt datetime not null, t time not null);
+create table t2 (dt datetime not null);
+insert into t1 values ('2001-01-01 1:1:1', '1:1:1'),
+('2001-01-01 1:1:1', '1:1:1');
+insert into t2 values ('2001-01-01 1:1:1'), ('2001-01-01 1:1:1');
+flush tables;
+EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
+flush tables;
+SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
+flush tables;
+EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
+flush tables;
+SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
+drop tables t1, t2;
+
# End of 5.0 tests.
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 15b4dce81b1..af2cb790ec8 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1,3 +1,9 @@
+# Note: This test is tricky. It reuses the prerequisites generated for
+# replication tests (master+slave server and connections) for its
+# own purposes. But the replication feature itself is stopped.
+#
+
+
# should work with embedded server after mysqltest is fixed
--source include/not_embedded.inc
--source include/federated.inc
@@ -7,10 +13,12 @@ connection default;
# Disable concurrent inserts to avoid test failures when reading
# data from concurrent connections (insert might return before
# the data is actually in the table).
-SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
connection slave;
+SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT= 0;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
@@ -24,7 +32,7 @@ CREATE TABLE federated.t1 (
connection master;
DROP TABLE IF EXISTS federated.t1;
# test too many items (malformed) in the comment string url
---error 1432
+--error ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`group` int NOT NULL default 0,
@@ -36,7 +44,7 @@ CREATE TABLE federated.t1 (
CONNECTION='mysql://root@127.0.0.1:@/too/many/items/federated/t1';
# test not enough items (malformed) in the comment string url
---error 1432
+--error ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`group` int NOT NULL default 0,
@@ -58,7 +66,7 @@ eval CREATE TABLE federated.t1 (
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t3';
---error 1431
+--error ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
SELECT * FROM federated.t1;
DROP TABLE federated.t1;
@@ -73,7 +81,7 @@ eval CREATE TABLE federated.t1 (
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://user:pass@127.0.0.1:$SLAVE_MYPORT/federated/t1';
---error 1429
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
SELECT * FROM federated.t1;
DROP TABLE federated.t1;
@@ -95,6 +103,7 @@ INSERT INTO federated.t1 (id, `group`) VALUES (3, 42);
INSERT INTO federated.t1 (id, `a\\b`) VALUES (4, 23);
INSERT INTO federated.t1 (id, `a\\`) VALUES (5, 1);
+--sorted_result
SELECT * FROM federated.t1;
DELETE FROM federated.t1;
DROP TABLE federated.t1;
@@ -197,12 +206,14 @@ INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010);
# basic select
+--sorted_result
SELECT * FROM federated.t1;
# with PRIMARY KEY index_read_idx
SELECT * FROM federated.t1 WHERE id = 5;
SELECT * FROM federated.t1 WHERE name = 'Sixth Name';
SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name';
SELECT * FROM federated.t1 WHERE name = 'Sixth Name' AND other = 44444;
+--sorted_result
SELECT * FROM federated.t1 WHERE name like '%th%';
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
SELECT * FROM federated.t1 WHERE name = '3rd name';
@@ -274,6 +285,7 @@ INSERT INTO federated.t1 (name, other, created)
VALUES ('Tenth Name', 101010, '2005-03-12 12:00:01');
# basic select
+--sorted_result
SELECT * FROM federated.t1;
# with PRIMARY KEY index_read_idx
SELECT * FROM federated.t1 WHERE id = 5;
@@ -282,6 +294,7 @@ SELECT * FROM federated.t1 WHERE id = 5;
SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name';
# with regular key index_read -> index_read_idx
SELECT * FROM federated.t1 WHERE other = 44444;
+--sorted_result
SELECT * FROM federated.t1 WHERE name like '%th%';
# update - update_row, index_read_idx
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
@@ -334,9 +347,12 @@ INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
INSERT INTO federated.t1 (other) VALUES ('fee fie foe fum');
+--sorted_result
SELECT * FROM federated.t1 WHERE other IS NULL;
+--sorted_result
SELECT * FROM federated.t1 WHERE name IS NULL;
SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL;
+--sorted_result
SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL;
UPDATE federated.t1
@@ -347,6 +363,7 @@ UPDATE federated.t1 SET other = 'two two two two' WHERE name = 'Second Name';
UPDATE federated.t1 SET other = 'seven seven' WHERE name like 'Sev%';
UPDATE federated.t1 SET name = 'Tenth Name' WHERE other like 'fee fie%';
SELECT * FROM federated.t1 WHERE name IS NULL OR other IS NULL ;
+--sorted_result
SELECT * FROM federated.t1;
# test multi-keys
@@ -417,6 +434,7 @@ INSERT INTO federated.t1 (name, bincol, floatval, other)
VALUES ('second', 0x66, 22.22, 2222);
INSERT INTO federated.t1 (name, bincol, floatval, other)
VALUES ('third', 'g', 22.22, 2222);
+--sorted_result
SELECT * FROM federated.t1;
SELECT * FROM federated.t1 WHERE name = 'second';
SELECT * FROM federated.t1 WHERE bincol= 'f';
@@ -425,6 +443,7 @@ SELECT * FROM federated.t1 WHERE bincol= 0x67;
SELECT * FROM federated.t1 WHERE bincol= 'g';
SELECT * FROM federated.t1 WHERE floatval=11.11;
SELECT * FROM federated.t1 WHERE name='third';
+--sorted_result
SELECT * FROM federated.t1 WHERE other=2222;
SELECT * FROM federated.t1 WHERE name='third' and other=2222;
@@ -498,32 +517,47 @@ SELECT * FROM federated.t1 WHERE id = 5
SELECT * FROM federated.t1 WHERE id = 5
AND col2 = 'five 5 five five 5' AND col3 = 5
AND col4 = 55555;
+--sorted_result
SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'five 5 five five 5')
OR (col2 = 'three Three' AND col3 = 33);
SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'Two two')
OR (col2 = 444 AND col3 = 4444444);
+--sorted_result
SELECT * FROM federated.t1 WHERE id = 1
OR col1 = 10
OR col2 = 'Two two'
OR col3 = 33
OR col4 = 4444444;
+--sorted_result
SELECT * FROM federated.t1 WHERE id > 5;
+--sorted_result
SELECT * FROM federated.t1 WHERE id >= 5;
+--sorted_result
SELECT * FROM federated.t1 WHERE id < 5;
+--sorted_result
SELECT * FROM federated.t1 WHERE id <= 5;
+--sorted_result
SELECT * FROM federated.t1 WHERE id != 5;
+--sorted_result
SELECT * FROM federated.t1 WHERE id > 3 AND id < 7;
+--sorted_result
SELECT * FROM federated.t1 WHERE id > 3 AND id <= 7;
+--sorted_result
SELECT * FROM federated.t1 WHERE id >= 3 AND id <= 7;
SELECT * FROM federated.t1 WHERE id < 3 AND id <= 7;
SELECT * FROM federated.t1 WHERE id < 3 AND id > 7;
+--sorted_result
SELECT * FROM federated.t1 WHERE id < 3 OR id > 7;
SELECT * FROM federated.t1 WHERE col2 = 'three Three';
+--sorted_result
SELECT * FROM federated.t1 WHERE col2 > 'one';
+--sorted_result
SELECT * FROM federated.t1 WHERE col2 LIKE 's%';
SELECT * FROM federated.t1 WHERE col2 LIKE 'si%';
SELECT * FROM federated.t1 WHERE col2 LIKE 'se%';
+--sorted_result
SELECT * FROM federated.t1 WHERE col2 NOT LIKE 'e%';
+--sorted_result
SELECT * FROM federated.t1 WHERE col2 <> 'one One';
# more multi-column indexes, in the primary key
@@ -577,13 +611,19 @@ SELECT * FROM federated.t1 WHERE col3 = 'bababababa';
SELECT * FROM federated.t1 WHERE col1 = 'gggg' AND col2 = 'ggggggggggggggggggg';
SELECT * FROM federated.t1 WHERE col1 = 'gggg' AND col3 = 'gagagagaga';
SELECT * FROM federated.t1 WHERE col1 = 'ffff' AND col4 = 'fcfcfcfcfcfcfcfc';
+--sorted_result
SELECT * FROM federated.t1 WHERE col1 > 'bbbb';
+--sorted_result
SELECT * FROM federated.t1 WHERE col1 >= 'bbbb';
SELECT * FROM federated.t1 WHERE col1 < 'bbbb';
+--sorted_result
SELECT * FROM federated.t1 WHERE col1 <= 'bbbb';
+--sorted_result
SELECT * FROM federated.t1 WHERE col1 <> 'bbbb';
SELECT * FROM federated.t1 WHERE col1 LIKE 'b%';
+--sorted_result
SELECT * FROM federated.t1 WHERE col4 LIKE '%b%';
+--sorted_result
SELECT * FROM federated.t1 WHERE col1 NOT LIKE 'c%';
SELECT * FROM federated.t1 WHERE col4 NOT LIKE '%c%';
connection slave;
@@ -614,11 +654,13 @@ INSERT INTO federated.t1 VALUES ('ccd', '112', 'zzzz');
# let's see what the foreign database says
connection slave;
+--sorted_result
SELECT col3 FROM federated.t1 WHERE (
(col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND
(col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111'));
connection master;
+--sorted_result
SELECT col3 FROM federated.t1 WHERE (
(col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND
(col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111'));
@@ -653,6 +695,7 @@ INSERT INTO federated.t1 (name, floatval, other)
VALUES ('foo', 33.33333332, NULL);
INSERT INTO federated.t1 (name, floatval, other)
VALUES (0, 00.3333, NULL);
+--sorted_result
SELECT * FROM federated.t1;
SELECT count(*) FROM federated.t1
WHERE id IS NULL
@@ -683,6 +726,7 @@ INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
INSERT INTO federated.t1 VALUES(4, "Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:");
+--sorted_result
SELECT * FROM federated.t1;
connection slave;
@@ -1041,6 +1085,7 @@ eval CREATE TABLE federated.t1 (
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
+--sorted_result
SELECT * FROM federated.t1;
# test blob indexes
SELECT * FROM federated.t1 WHERE fileguts = 'jimbob';
@@ -1061,6 +1106,7 @@ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
INSERT INTO federated.t1 VALUES (0x00);
INSERT INTO federated.t1 VALUES (0x0001);
INSERT INTO federated.t1 VALUES (0x0100);
+--sorted_result
SELECT HEX(a) FROM federated.t1;
# # simple tests for cyrillic, given to me by
@@ -1139,6 +1185,7 @@ INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
#inner join
+--sorted_result
SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
federated.t1.other AS other, federated.countries.country AS country
FROM federated.t1, federated.countries WHERE
@@ -1212,7 +1259,7 @@ INSERT INTO federated.alter_me (id, name) VALUES (2, 'David');
SELECT * FROM federated.alter_me;
---error 1031
+--error ER_ILLEGAL_HA
ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL;
SELECT * FROM federated.alter_me;
@@ -1884,4 +1931,9 @@ create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
--echo End of 5.1 tests
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
+connection slave;
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
+
+connection default;
source include/federated_cleanup.inc;
diff --git a/mysql-test/t/federated_bug_25714.test b/mysql-test/t/federated_bug_25714.test
index 26ff143135a..6d112cae5b8 100644
--- a/mysql-test/t/federated_bug_25714.test
+++ b/mysql-test/t/federated_bug_25714.test
@@ -1,15 +1,16 @@
--source include/have_bug25714.inc
source include/federated.inc;
-connection default;
-
+connection master;
# Disable concurrent inserts to avoid test failures when reading
# data from concurrent connections (insert might return before
# the data is actually in the table).
-SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
connection slave;
+SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT= 0;
--disable_warnings
DROP TABLE IF EXISTS federated.bug_13118_table;
--enable_warnings
@@ -46,11 +47,12 @@ SELECT LAST_INSERT_ID();
SELECT * from federated.t1;
DROP TABLE federated.t1;
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
connection slave;
DROP TABLE federated.t1;
+SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
+
source include/federated_cleanup.inc;
-connection default;
-SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index b6143bc0c78..4eedd433d34 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -933,5 +933,45 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
DROP TABLE t1;
+#
+# Bug #37348: Crash in or immediately after JOIN::make_sum_func_list
+#
+
+CREATE TABLE derived1 (a bigint(21));
+INSERT INTO derived1 VALUES (2);
+
+
+CREATE TABLE D (
+ pk int(11) NOT NULL AUTO_INCREMENT,
+ int_nokey int(11) DEFAULT NULL,
+ int_key int(11) DEFAULT NULL,
+ filler blob,
+ PRIMARY KEY (pk),
+ KEY int_key (int_key)
+);
+
+INSERT INTO D VALUES
+ (39,40,4,repeat(' X', 42)),
+ (43,56,4,repeat(' X', 42)),
+ (47,12,4,repeat(' X', 42)),
+ (71,28,4,repeat(' X', 42)),
+ (76,54,4,repeat(' X', 42)),
+ (83,45,4,repeat(' X', 42)),
+ (105,53,12,NULL);
+
+SELECT
+ (SELECT COUNT( int_nokey )
+ FROM derived1 AS X
+ WHERE
+ X.int_nokey < 61
+ GROUP BY pk
+ LIMIT 1)
+FROM D AS X
+WHERE X.int_key < 13
+GROUP BY int_nokey LIMIT 1;
+
+DROP TABLE derived1;
+DROP TABLE D;
+
###
--echo End of 5.0 tests
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index d02e8e10a2b..36aef981f21 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -940,6 +940,35 @@ select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order b
SET sql_mode=@save_sql_mode;
DROP TABLE t1, t2;
+--echo #
+--echo # BUG#38072: Wrong result: HAVING not observed in a query with aggregate
+--echo #
+CREATE TABLE t1 (
+ pk int(11) NOT NULL AUTO_INCREMENT,
+ int_nokey int(11) NOT NULL,
+ int_key int(11) NOT NULL,
+ varchar_key varchar(1) NOT NULL,
+ varchar_nokey varchar(1) NOT NULL,
+ PRIMARY KEY (pk),
+ KEY int_key (int_key),
+ KEY varchar_key (varchar_key)
+);
+INSERT INTO t1 VALUES
+(1,5,5, 'h','h'),
+(2,1,1, '{','{'),
+(3,1,1, 'z','z'),
+(4,8,8, 'x','x'),
+(5,7,7, 'o','o'),
+(6,3,3, 'p','p'),
+(7,9,9, 'c','c'),
+(8,0,0, 'k','k'),
+(9,6,6, 't','t'),
+(10,0,0,'c','c');
+
+explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+drop table t1;
+
--echo End of 5.0 tests
# Bug #21174: Index degrades sort performance and
# optimizer does not honor IGNORE INDEX.
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index bb9cb127d07..4027293da66 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1338,4 +1338,12 @@ where state='User sleep' and
info='select * from information_schema.columns where 1=sleep(100000)';
--source include/wait_condition.inc
+
+#
+# Bug#38918 selecting from information_schema.columns is disproportionately slow
+#
+explain select count(*) from information_schema.tables;
+explain select count(*) from information_schema.columns;
+explain select count(*) from information_schema.views;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test
index 666f331c7b9..6353e94fd51 100644
--- a/mysql-test/t/information_schema_db.test
+++ b/mysql-test/t/information_schema_db.test
@@ -82,6 +82,7 @@ drop function func2;
drop database `inf%`;
drop procedure mbase.p1;
drop database mbase;
+disconnect user1;
#
# Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
@@ -210,3 +211,32 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
drop database testdb_1;
drop user testdb_1@localhost;
drop user testdb_2@localhost;
+
+#
+# Bug#22763 Disrepancy between SHOW CREATE VIEW and I_S.VIEWS
+#
+create database testdb_1;
+create table testdb_1.t1 (a int);
+create view testdb_1.v1 as select * from testdb_1.t1;
+
+grant show view on testdb_1.* to mysqltest_1@localhost;
+grant select on testdb_1.v1 to mysqltest_1@localhost;
+
+connect (user1,localhost,mysqltest_1,,test);
+connection user1;
+select table_schema, table_name, view_definition from information_schema.views
+where table_name='v1';
+show create view testdb_1.v1;
+
+connection default;
+revoke select on testdb_1.v1 from mysqltest_1@localhost;
+connection user1;
+select table_schema, table_name, view_definition from information_schema.views
+where table_name='v1';
+--error ER_TABLEACCESS_DENIED_ERROR
+show create view testdb_1.v1;
+
+connection default;
+drop user mysqltest_1@localhost;
+drop database testdb_1;
+disconnect user1;
diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/t/innodb-semi-consistent.test
index c33126b93ff..a3496625e95 100644
--- a/mysql-test/t/innodb-semi-consistent.test
+++ b/mysql-test/t/innodb-semi-consistent.test
@@ -10,6 +10,7 @@ drop table if exists t1;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
+set binlog_format=mixed;
set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
@@ -17,6 +18,7 @@ set autocommit=0;
# this should lock the entire table
select * from t1 where a=3 lock in share mode;
connection b;
+set binlog_format=mixed;
set session transaction isolation level read committed;
set autocommit=0;
-- error ER_LOCK_WAIT_TIMEOUT
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 1073f5535df..339be87419a 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -701,6 +701,7 @@ insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
select id, code, name from t1 order by id;
COMMIT;
+SET binlog_format='MIXED';
BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
@@ -2000,10 +2001,12 @@ connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1;
connection b;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
#
@@ -2071,6 +2074,7 @@ commit;
set autocommit = 0;
select * from t2 for update;
connection b;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2;
@@ -2127,46 +2131,55 @@ commit;
set autocommit = 0;
select * from t2 for update;
connection b;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send
insert into t1 select * from t2;
connection c;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send
update t3 set b = (select b from t2 where a = d);
connection d;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
connection e;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send
insert into t5 (select * from t2 lock in share mode);
connection f;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send
update t6 set e = (select b from t2 where a = d lock in share mode);
connection g;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
connection h;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send
insert into t8 (select * from t2 for update);
connection i;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send
update t9 set e = (select b from t2 where a = d for update);
connection j;
+SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send
@@ -2380,6 +2393,7 @@ DROP TABLE t1;
CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,);
CONNECTION c1;
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
DROP TABLE IF EXISTS t1, t2;
@@ -2387,6 +2401,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1;
SELECT * FROM t2;
CONNECTION c2;
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1);
@@ -2398,10 +2413,12 @@ DISCONNECT c2;
CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,);
CONNECTION c1;
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
SELECT * FROM t2;
CONNECTION c2;
+SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2);
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index bcdb1328cb7..ed8de208474 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -29,3 +29,17 @@ insert into t2 select @a:=A.a+10*(B.a + 10*C.a),@a, @a from t1 A, t1 B, t1 C;
explain select a from t2 where a=b;
drop table t1, t2;
+#
+# Bug #40360: Binlog related errors with binlog off
+#
+# This bug is triggered when the binlog format is STATEMENT and the
+# binary log is turned off. In this case, no error should be shown for
+# the statement since there are no replication issues.
+
+SET SESSION BINLOG_FORMAT=STATEMENT;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+query_vertical select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
+CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+DROP TABLE t1;
+
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 09082cbd7a7..b5e30e63f54 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -546,10 +546,12 @@ select * from v1a join v1b on t1.b = t2.b;
#
# Bug #17523 natural join and information_schema
#
-# We mask out the Privileges column because it differs with embedded server
---replace_column 31 # 10 #
-select * from information_schema.statistics join information_schema.columns
- using(table_name,column_name) where table_name='user';
+# Omit columns.PRIVILIGES as it may vary with embedded server.
+# Omit columns.ORDINAL_POSITION and statistics.CARDINALITY as it may vary with hostname='localhost'.
+select
+ statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.COLLATION, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.COMMENT,
+ columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
+ from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user';
drop table t1;
drop table t2;
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test
index 9cccca1adc3..5847b90367a 100644
--- a/mysql-test/t/limit.test
+++ b/mysql-test/t/limit.test
@@ -95,3 +95,11 @@ set @a=-14632475938453979136;
execute s using @a, @a;
--echo End of 5.0 tests
+
+#
+# Bug#37075: offset of limit clause might be truncated to 0 on 32-bits server w/o big tables
+#
+
+select 1 as a limit 4294967296,10;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index affb6c3bac7..46de411677c 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -320,9 +320,191 @@ DROP VIEW v3;
--echo
--echo # -- End of Bug#35469.
+
+
###########################################################################
-# End of 5.0 tests
+#
+# Bug#37114: sql_mode NO_BACKSLASH_ESCAPES does not work properly with
+# LOAD DATA INFILE
+#
+
+# - For each plain "SELECT id,...", the 1st pair ("before" SELECT...OUTFILE,
+# LOAD...INFILE) and the 2nd pair of lines ("after") in the result should
+# look the same, otherwise we broke the dumpe/restore cycle!
+#
+# - the \r is always { '\\', 'r' } in memory, but on-disk format changes
+#
+# - the \t is { '\t' } or { '\\', 't' } in memory depending on whether \
+# is magic (that is, NO_BACKSLASH_ESCAPES is not set) at INSERT-time.
+# on-disk format varies.
+#
+# - while INFILE/OUTFILE behaviour changes according to NO_BACKSLASH_ESCAPES,
+# we can override these defaults using ESCAPED BY '...'
+# 1: NO_BACKSLASH_ESCAPES default, \ on-disk: \,t,x,\r
+# 2: NO_BACKSLASH_ESCAPES override, \\ on-disk: \,\,t,x,\,\,r
+# 3: !NO_BACKSLASH_ESCAPES default, \\ on-disk: tab,\,\,r
+# 3: !NO_BACKSLASH_ESCAPES override, \ on-disk: tab,\,r
+
+--echo Bug#37114
+
+SET SESSION character_set_client=latin1;
+SET SESSION character_set_server=latin1;
+SET SESSION character_set_connection=latin1;
+SET @OLD_SQL_MODE=@@SESSION.SQL_MODE;
+
+# 0. test LOAD DATA INFILE first; if that works, all issues in
+# SELECT INTO OUTFILE / LOAD DATA INFILE cycles below are
+# arguably in the saving.
+
+--echo test LOAD DATA INFILE
+
+--let $file=$MYSQLTEST_VARDIR/tmp/bug37114.txt
+--let $file2=$MYSQLTEST_VARDIR/tmp/bug37114_out.txt
+
+SET sql_mode = '';
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT '1 \\\\aa\n' INTO DUMPFILE '$file'
+
+CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM;
+
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$file' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ' '
+SELECT * FROM t1;
+
+# show we can write this with OUTFILE, forcing the parameters for now
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT * INTO OUTFILE '$file2' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1
+--diff_files $file $file2
+--remove_file $file2
+
+# now show the OUTFILE defaults are correct with NO_BACKSLASH_ESCAPES
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT * INTO OUTFILE '$file2' FIELDS TERMINATED BY ' ' FROM t1
+--diff_files $file $file2
+--remove_file $file2
+
+INSERT INTO t1 (id, val1) VALUES (1, '\aa');
+SELECT * FROM t1;
+
+SET sql_mode='';
+INSERT INTO t1 (id, val1) VALUES (1, '\aa');
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+--remove_file $file
+
+
+
+--echo test SELECT INTO OUTFILE
+
+CREATE TABLE t1 (id INT PRIMARY KEY, val1 CHAR(4));
+CREATE TABLE t2 LIKE t1;
+
+# 1. with NO_BACKSLASH_ESCAPES on
+
+SET sql_mode = '';
+INSERT INTO t1 (id, val1) VALUES (5, '\ttab');
+INSERT INTO t1 (id, val1) VALUES (4, '\\r');
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+INSERT INTO t1 (id, val1) VALUES (3, '\tx');
+
+--echo 1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' '
+
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+ SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+
+TRUNCATE t2;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT LOAD_FILE("$file");
+--remove_file $file
+
+
+
+--echo 1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' '
+
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+ SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+
+TRUNCATE t2;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT LOAD_FILE("$file");
+--remove_file $file
+
+
+
+# 2. with NO_BACKSLASH_ESCAPES off
+
+SET sql_mode = '';
+
+--echo 2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' '
+
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+ SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+
+TRUNCATE t2;
+
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT LOAD_FILE("$file");
+--remove_file $file
+
+SET sql_mode = '';
+
+
+
+--echo 2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' '
+
+SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
+ SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
+
+TRUNCATE t2;
+
+SET sql_mode = 'NO_BACKSLASH_ESCAPES';
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT LOAD_FILE("$file");
+--remove_file $file
+
+# clean up
+set session sql_mode=@OLD_SQL_MODE;
+DROP TABLE t1,t2;
+
+
+
+--echo End of 5.0 tests
+
#
@@ -347,3 +529,7 @@ DROP TABLE t1;
remove_file $MYSQLTEST_VARDIR/master-data/test/t@002d1;
SET character_set_filesystem=default;
select @@character_set_filesystem;
+
+
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 54c2e4e76ee..08747b0f92e 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -291,7 +291,328 @@ connection reader;
reap;
connection locker;
drop table t1;
+
+#
+# Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
+# ``FLUSH TABLES WITH READ LOCK''
+#
+
+--connection default
+CREATE TABLE t1 (
+ a int(11) unsigned default NULL,
+ b varchar(255) default NULL,
+ UNIQUE KEY a (a),
+ KEY b (b)
+);
+
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
+CREATE TABLE t2 SELECT * FROM t1;
+CREATE TABLE t3 SELECT * FROM t1;
+
+--echo # test altering of columns that multiupdate doesn't use
+
+--echo # normal mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+ send UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a)
+ SET a = NULL WHERE t1.b <> t2.b;
+
+--connection locker
+ ALTER TABLE t2 ADD COLUMN (c INT);
+ ALTER TABLE t2 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+
+--echo # PS mode
+
+--connection writer
+PREPARE stmt FROM 'UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a)
+ SET a = NULL WHERE t1.b <> t2.b';
+
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+--send EXECUTE stmt
+
+--connection locker
+ ALTER TABLE t2 ADD COLUMN (c INT);
+ ALTER TABLE t2 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+--enable_query_log
+
+
+--echo # test altering of columns that multiupdate uses
+
+--echo # normal mode
+
+--connection default
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+ dec $i;
+
+--connection locker
+--error 0,1060
+ ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
+ UPDATE t2 SET a=b;
+
+--connection writer
+--send UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a) SET a = NULL WHERE t1.b <> t2.b
+
+--connection locker
+--error 0,1091
+ ALTER TABLE t2 DROP COLUMN a;
+
+--connection writer
+--error 0,1054
+--reap
+}
+--enable_query_log
+
+--echo # PS mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+ dec $i;
+
+--connection locker
+--error 0,1060
+ ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
+ UPDATE t2 SET a=b;
+
+--connection writer
+ PREPARE stmt FROM 'UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a) SET a = NULL WHERE t1.b <> t2.b';
+--send EXECUTE stmt
+
+--connection locker
+--error 0,1091
+ ALTER TABLE t2 DROP COLUMN a;
+
+--connection writer
+--error 0,1054
+--reap
+
+}
+--enable_query_log
+--connection default
+DROP TABLE t1, t2, t3;
+
#
+# Bug#38499: flush tables and multitable table update with derived table cause
+# crash
+#
+
+CREATE TABLE t1( a INT, b INT );
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
+
+--echo # 1. test regular tables
+--echo # 1.1. test altering of columns that multiupdate doesn't use
+--echo # 1.1.1. normal mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+ send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
+
+--connection locker
+ ALTER TABLE t1 ADD COLUMN (c INT);
+ ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+
+--echo # 1.1.2. PS mode
+
+--connection writer
+PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
+
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+--send EXECUTE stmt
+
+--connection locker
+ ALTER TABLE t1 ADD COLUMN (c INT);
+ ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+--enable_query_log
+
+--echo # 1.2. test altering of columns that multiupdate uses
+--echo # 1.2.1. normal mode
+
+--connection default
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+ dec $i;
+
+--connection locker
+--error 0,1060
+ ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
+ UPDATE t1 SET a=b;
+
+--connection writer
+--send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
+
+--connection locker
+--error 0,1091
+ ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,1054 # unknown column error
+--reap
+}
+--enable_query_log
+
+--echo # 1.2.2. PS mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+ dec $i;
+
+--connection locker
+--error 0,1060
+ ALTER TABLE t1 ADD COLUMN a INT;
+ UPDATE t1 SET a=b;
+
+--connection writer
+ PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
+--send EXECUTE stmt
+
+--connection locker
+--error 0,1091
+ ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,1054 # Unknown column 'a' in 'field list'
+--reap
+}
+--enable_query_log
+--connection default
+ALTER TABLE t1 ADD COLUMN a INT;
+
+--echo # 2. test UNIONs
+--echo # 2.1. test altering of columns that multiupdate doesn't use
+--echo # 2.1.1. normal mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+ send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
+
+--connection locker
+ ALTER TABLE t1 ADD COLUMN (c INT);
+ ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+
+--echo # 2.1.2. PS mode
+
+--connection writer
+PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
+
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+--send EXECUTE stmt
+
+--connection locker
+ ALTER TABLE t1 ADD COLUMN (c INT);
+ ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+--enable_query_log
+
+--echo # 2.2. test altering of columns that multiupdate uses
+--echo # 2.2.1. normal mode
+
+--connection default
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+ dec $i;
+
+--connection locker
+--error 0,1060
+ ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
+ UPDATE t1 SET a=b;
+
+--connection writer
+--send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
+
+--connection locker
+--error 0,1091
+ ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,1054 # Unknown column 'a' in 'field list'
+--reap
+}
+--enable_query_log
+
+--echo # 2.2.2. PS mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+ dec $i;
+
+--connection locker
+--error 0,1060
+ ALTER TABLE t1 ADD COLUMN a INT;
+ UPDATE t1 SET a=b;
+
+--connection writer
+ PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
+--send EXECUTE stmt
+
+--connection locker
+--error 0,1091
+ ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,1054 # Unknown column 'a' in 'field list'
+--reap
+}
+--enable_query_log
+--connection default
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/log_basic.test b/mysql-test/t/log_basic.test
index 16d7a4bfe7f..b9a64f8981b 100644
--- a/mysql-test/t/log_basic.test
+++ b/mysql-test/t/log_basic.test
@@ -38,9 +38,9 @@ SELECT @@global.log AS INIT_VALUE;
SELECT @@log AS INIT_VALUE;
-SET @@global.log = ON;
+SET @@global.general_log = ON;
-SET global log = 0;
+SET global general_log = 0;
--echo 'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
--echo 'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 2fd2cabc97c..977b74aa1e3 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -259,6 +259,32 @@ SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
###########################################################################
+
+
+## WL#4403 - deprecate @log and @slow_log_queries variables
+
+## these are all deprecated -- show for command-line as well!
+--echo deprecated:
+SET GLOBAL log = 0;
+SET GLOBAL log_slow_queries = 0;
+SET GLOBAL log = DEFAULT;
+SET GLOBAL log_slow_queries = DEFAULT;
+
+## these are NOT deprecated
+--echo not deprecated:
+SELECT @@global.general_log_file INTO @my_glf;
+SELECT @@global.slow_query_log_file INTO @my_sqlf;
+SET GLOBAL general_log = 0;
+SET GLOBAL slow_query_log = 0;
+SET GLOBAL general_log_file = 'WL4403_G.log';
+SET GLOBAL slow_query_log_file = 'WL4403_SQ.log';
+SET GLOBAL general_log_file = @my_glf;
+SET GLOBAL slow_query_log_file = @my_sqlf;
+SET GLOBAL general_log = DEFAULT;
+SET GLOBAL slow_query_log = DEFAULT;
+
+
+
--echo End of 5.1 tests
--enable_ps_protocol
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index 3047d16d3b6..bdd22538c14 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -10,6 +10,21 @@
--disable_ps_protocol
use mysql;
+# Capture initial settings of system variables
+# so that we can revert to old state after manipulation for testing
+# NOTE: PLEASE USE THESE VALUES TO 'RESET' SYSTEM VARIABLES
+# Capturing old values within the tests results in loss of values
+# due to people not paying attention to previous tests' changes, captures
+# or improper cleanup
+SET @saved_long_query_time = @@long_query_time;
+SET @saved_log_output = @@log_output;
+SET @saved_general_log = @@GLOBAL.general_log;
+SET @saved_slow_query_log = @@GLOBAL.slow_query_log;
+
+SELECT @saved_long_query_time, @saved_log_output, @saved_general_log, @saved_slow_query_log;
+
+
+
#
# Check that log tables work and we can do basic selects. This also
# tests truncate, which works in a special mode with the log tables
@@ -161,6 +176,7 @@ set session long_query_time=1;
select sleep(2);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
select * from mysql.slow_log;
+set @@session.long_query_time = @saved_long_query_time;
#
# Bug #18559 log tables cannot change engine, and gets deadlocked when
@@ -305,6 +321,7 @@ unlock tables;
# Bug #21785 Server crashes after rename of the log table
#
+SET SESSION long_query_time = 1000;
--disable_warnings
drop table if exists mysql.renamed_general_log;
drop table if exists mysql.renamed_slow_log;
@@ -365,6 +382,7 @@ set global slow_query_log='ON';
RENAME TABLE general_log2 TO general_log;
RENAME TABLE slow_log2 TO slow_log;
+SET SESSION long_query_time = @saved_long_query_time;
# this should work
set global general_log='ON';
@@ -476,8 +494,6 @@ ALTER TABLE mysql.general_log ENGINE = CSV;
## test the slow query log
-SET @old_long_query_time:=@@long_query_time;
-
SET GLOBAL slow_query_log = 0;
FLUSH LOGS;
@@ -503,12 +519,14 @@ SELECT "My own slow query", sleep(2);
SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
SET GLOBAL slow_query_log = 0;
-SET SESSION long_query_time =@old_long_query_time;
+SET SESSION long_query_time =@saved_long_query_time;
FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
+
#
# Bug#25422 (Hang with log tables)
#
@@ -790,9 +808,6 @@ END //
DELIMITER ;//
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
-
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
@@ -814,8 +829,8 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
+SET GLOBAL general_log = @saved_general_log;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
#
# Bug#21557 entries in the general query log truncated at 1000 characters.
@@ -823,7 +838,6 @@ SET GLOBAL slow_query_log = @old_slow_log_state;
select CONNECTION_ID() into @thread_id;
truncate table mysql.general_log;
-set @old_general_log_state = @@global.general_log;
set global general_log = on;
--disable_result_log
set @lparam = "000 001 002 003 004 005 006 007 008 009"
@@ -934,12 +948,54 @@ execute long_query using @lparam;
set global general_log = off;
select command_type, argument from mysql.general_log where thread_id = @thread_id;
deallocate prepare long_query;
-set global general_log = @old_general_log_state;
+set global general_log = @saved_general_log;
+
+#
+# Bug#34306: Can't make copy of log tables when server binary log is enabled
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS log_count;
+DROP TABLE IF EXISTS slow_log_copy;
+DROP TABLE IF EXISTS general_log_copy;
+--enable_warnings
+
+CREATE TABLE log_count (count BIGINT(21));
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
+CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
+DROP TABLE slow_log_copy;
+
+CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
+DROP TABLE general_log_copy;
+
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+
+CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
+DROP TABLE slow_log_copy;
+
+CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
+INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
+DROP TABLE general_log_copy;
+
+SET GLOBAL general_log = @saved_general_log;
+SET GLOBAL slow_query_log = @saved_slow_query_log;
+
+DROP TABLE log_count;
#
# Bug #31700: thd->examined_row_count not incremented for 'const' type queries
#
-SET @old_slow_log_state = @@global.slow_query_log;
SET SESSION long_query_time = 0;
SET GLOBAL slow_query_log = ON;
@@ -964,5 +1020,10 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
-SET GLOBAL slow_query_log = @old_slow_log_state;
-SET SESSION long_query_time =@old_long_query_time;
+# RESET altered system variables before exiting the test
+SET GLOBAL slow_query_log = @saved_slow_query_log;
+SET GLOBAL general_log=@saved_general_log;
+SET SESSION long_query_time =@saved_long_query_time;
+SET GLOBAL LOG_OUTPUT = @saved_log_output;
+
+
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index cd91f8a850a..6e5d2aee7fd 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -461,7 +461,7 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM t2;
DROP TABLE t1, t2;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
---error ER_NO_SUCH_TABLE
+--error 1168
SELECT * FROM t2;
DROP TABLE t2;
@@ -553,11 +553,11 @@ drop table t1;
# CREATE TABLE fails
#
CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2);
---error ER_NO_SUCH_TABLE
+--error 1168
SELECT * FROM tm1;
CHECK TABLE tm1;
CREATE TABLE t1(a INT);
---error ER_NO_SUCH_TABLE
+--error 1168
SELECT * FROM tm1;
CHECK TABLE tm1;
CREATE TABLE t2(a BLOB);
@@ -883,7 +883,7 @@ DROP TABLE t4;
--echo # 2. Normal rename.
SELECT * FROM t3 ORDER BY c1;
RENAME TABLE t2 TO t5;
---error ER_NO_SUCH_TABLE
+--error 1168
SELECT * FROM t3 ORDER BY c1;
RENAME TABLE t5 TO t2;
SELECT * FROM t3 ORDER BY c1;
@@ -901,7 +901,7 @@ UNLOCK TABLES;
--echo #
--echo # 4. Alter table rename.
ALTER TABLE t2 RENAME TO t5;
---error ER_NO_SUCH_TABLE
+--error 1168
SELECT * FROM t3 ORDER BY c1;
ALTER TABLE t5 RENAME TO t2;
SELECT * FROM t3 ORDER BY c1;
@@ -961,7 +961,7 @@ CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1)
LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
---error ER_NO_SUCH_TABLE
+--error 1168
SELECT * FROM t2;
--error ER_NO_SUCH_TABLE
SELECT * FROM t1;
@@ -1400,6 +1400,19 @@ UNLOCK TABLES;
DROP TABLE t1, m1;
#
+# Bug#35068 - Assertion fails when reading from i_s.tables
+# and there is incorrect merge table
+#
+CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST;
+--replace_column 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 19 # 20 #
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
+TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
+
+DROP TABLE tm1;
+
+--echo End of 5.1 tests
+
+#
# Bug#36006 - Optimizer does table scan for select count(*)
#
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
index 65c062399b7..a10767579fb 100644
--- a/mysql-test/t/metadata.test
+++ b/mysql-test/t/metadata.test
@@ -112,4 +112,21 @@ SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2;
DROP VIEW v1,v2;
DROP TABLE t1,t2;
+#
+# Bug #39283: Date returned as VARBINARY to client for queries
+# with COALESCE and JOIN
+#
+
+CREATE TABLE t1 (i INT, d DATE);
+INSERT INTO t1 VALUES (1, '2008-01-01'), (2, '2008-01-02'), (3, '2008-01-03');
+
+--enable_metadata
+--sorted_result
+SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d),
+ CASE i WHEN i THEN d ELSE d END, GREATEST(d, d), LEAST(d, d)
+ FROM t1 ORDER BY RAND(); # force filesort
+--disable_metadata
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test
index 359c4ea5793..1e8b9647503 100644
--- a/mysql-test/t/mysqldump-max.test
+++ b/mysql-test/t/mysqldump-max.test
@@ -66,3 +66,1061 @@ drop table t3;
drop table t4;
drop table t5;
drop table t6;
+
+
+#
+# Bug#31434 - mysqldump dumps view as table
+#
+
+# Show that mysqldump's stand-in tables for views are always of MyISAM
+# type to avoid Inno's column-number limits (~1000 columns) etc.
+# Here because it needs Inno-engine.
+
+SELECT @@global.storage_engine INTO @old_engine;
+SET GLOBAL storage_engine=InnoDB;
+
+--disable_query_log
+CREATE TABLE `t1` (
+ `col_0` tinyint(1) default NULL,
+ `col_1` tinyint(1) default NULL,
+ `col_2` tinyint(1) default NULL,
+ `col_3` tinyint(1) default NULL,
+ `col_4` tinyint(1) default NULL,
+ `col_5` tinyint(1) default NULL,
+ `col_6` tinyint(1) default NULL,
+ `col_7` tinyint(1) default NULL,
+ `col_8` tinyint(1) default NULL,
+ `col_9` tinyint(1) default NULL,
+ `col_10` tinyint(1) default NULL,
+ `col_11` tinyint(1) default NULL,
+ `col_12` tinyint(1) default NULL,
+ `col_13` tinyint(1) default NULL,
+ `col_14` tinyint(1) default NULL,
+ `col_15` tinyint(1) default NULL,
+ `col_16` tinyint(1) default NULL,
+ `col_17` tinyint(1) default NULL,
+ `col_18` tinyint(1) default NULL,
+ `col_19` tinyint(1) default NULL,
+ `col_20` tinyint(1) default NULL,
+ `col_21` tinyint(1) default NULL,
+ `col_22` tinyint(1) default NULL,
+ `col_23` tinyint(1) default NULL,
+ `col_24` tinyint(1) default NULL,
+ `col_25` tinyint(1) default NULL,
+ `col_26` tinyint(1) default NULL,
+ `col_27` tinyint(1) default NULL,
+ `col_28` tinyint(1) default NULL,
+ `col_29` tinyint(1) default NULL,
+ `col_30` tinyint(1) default NULL,
+ `col_31` tinyint(1) default NULL,
+ `col_32` tinyint(1) default NULL,
+ `col_33` tinyint(1) default NULL,
+ `col_34` tinyint(1) default NULL,
+ `col_35` tinyint(1) default NULL,
+ `col_36` tinyint(1) default NULL,
+ `col_37` tinyint(1) default NULL,
+ `col_38` tinyint(1) default NULL,
+ `col_39` tinyint(1) default NULL,
+ `col_40` tinyint(1) default NULL,
+ `col_41` tinyint(1) default NULL,
+ `col_42` tinyint(1) default NULL,
+ `col_43` tinyint(1) default NULL,
+ `col_44` tinyint(1) default NULL,
+ `col_45` tinyint(1) default NULL,
+ `col_46` tinyint(1) default NULL,
+ `col_47` tinyint(1) default NULL,
+ `col_48` tinyint(1) default NULL,
+ `col_49` tinyint(1) default NULL,
+ `col_50` tinyint(1) default NULL,
+ `col_51` tinyint(1) default NULL,
+ `col_52` tinyint(1) default NULL,
+ `col_53` tinyint(1) default NULL,
+ `col_54` tinyint(1) default NULL,
+ `col_55` tinyint(1) default NULL,
+ `col_56` tinyint(1) default NULL,
+ `col_57` tinyint(1) default NULL,
+ `col_58` tinyint(1) default NULL,
+ `col_59` tinyint(1) default NULL,
+ `col_60` tinyint(1) default NULL,
+ `col_61` tinyint(1) default NULL,
+ `col_62` tinyint(1) default NULL,
+ `col_63` tinyint(1) default NULL,
+ `col_64` tinyint(1) default NULL,
+ `col_65` tinyint(1) default NULL,
+ `col_66` tinyint(1) default NULL,
+ `col_67` tinyint(1) default NULL,
+ `col_68` tinyint(1) default NULL,
+ `col_69` tinyint(1) default NULL,
+ `col_70` tinyint(1) default NULL,
+ `col_71` tinyint(1) default NULL,
+ `col_72` tinyint(1) default NULL,
+ `col_73` tinyint(1) default NULL,
+ `col_74` tinyint(1) default NULL,
+ `col_75` tinyint(1) default NULL,
+ `col_76` tinyint(1) default NULL,
+ `col_77` tinyint(1) default NULL,
+ `col_78` tinyint(1) default NULL,
+ `col_79` tinyint(1) default NULL,
+ `col_80` tinyint(1) default NULL,
+ `col_81` tinyint(1) default NULL,
+ `col_82` tinyint(1) default NULL,
+ `col_83` tinyint(1) default NULL,
+ `col_84` tinyint(1) default NULL,
+ `col_85` tinyint(1) default NULL,
+ `col_86` tinyint(1) default NULL,
+ `col_87` tinyint(1) default NULL,
+ `col_88` tinyint(1) default NULL,
+ `col_89` tinyint(1) default NULL,
+ `col_90` tinyint(1) default NULL,
+ `col_91` tinyint(1) default NULL,
+ `col_92` tinyint(1) default NULL,
+ `col_93` tinyint(1) default NULL,
+ `col_94` tinyint(1) default NULL,
+ `col_95` tinyint(1) default NULL,
+ `col_96` tinyint(1) default NULL,
+ `col_97` tinyint(1) default NULL,
+ `col_98` tinyint(1) default NULL,
+ `col_99` tinyint(1) default NULL,
+ `col_100` tinyint(1) default NULL,
+ `col_101` tinyint(1) default NULL,
+ `col_102` tinyint(1) default NULL,
+ `col_103` tinyint(1) default NULL,
+ `col_104` tinyint(1) default NULL,
+ `col_105` tinyint(1) default NULL,
+ `col_106` tinyint(1) default NULL,
+ `col_107` tinyint(1) default NULL,
+ `col_108` tinyint(1) default NULL,
+ `col_109` tinyint(1) default NULL,
+ `col_110` tinyint(1) default NULL,
+ `col_111` tinyint(1) default NULL,
+ `col_112` tinyint(1) default NULL,
+ `col_113` tinyint(1) default NULL,
+ `col_114` tinyint(1) default NULL,
+ `col_115` tinyint(1) default NULL,
+ `col_116` tinyint(1) default NULL,
+ `col_117` tinyint(1) default NULL,
+ `col_118` tinyint(1) default NULL,
+ `col_119` tinyint(1) default NULL,
+ `col_120` tinyint(1) default NULL,
+ `col_121` tinyint(1) default NULL,
+ `col_122` tinyint(1) default NULL,
+ `col_123` tinyint(1) default NULL,
+ `col_124` tinyint(1) default NULL,
+ `col_125` tinyint(1) default NULL,
+ `col_126` tinyint(1) default NULL,
+ `col_127` tinyint(1) default NULL,
+ `col_128` tinyint(1) default NULL,
+ `col_129` tinyint(1) default NULL,
+ `col_130` tinyint(1) default NULL,
+ `col_131` tinyint(1) default NULL,
+ `col_132` tinyint(1) default NULL,
+ `col_133` tinyint(1) default NULL,
+ `col_134` tinyint(1) default NULL,
+ `col_135` tinyint(1) default NULL,
+ `col_136` tinyint(1) default NULL,
+ `col_137` tinyint(1) default NULL,
+ `col_138` tinyint(1) default NULL,
+ `col_139` tinyint(1) default NULL,
+ `col_140` tinyint(1) default NULL,
+ `col_141` tinyint(1) default NULL,
+ `col_142` tinyint(1) default NULL,
+ `col_143` tinyint(1) default NULL,
+ `col_144` tinyint(1) default NULL,
+ `col_145` tinyint(1) default NULL,
+ `col_146` tinyint(1) default NULL,
+ `col_147` tinyint(1) default NULL,
+ `col_148` tinyint(1) default NULL,
+ `col_149` tinyint(1) default NULL,
+ `col_150` tinyint(1) default NULL,
+ `col_151` tinyint(1) default NULL,
+ `col_152` tinyint(1) default NULL,
+ `col_153` tinyint(1) default NULL,
+ `col_154` tinyint(1) default NULL,
+ `col_155` tinyint(1) default NULL,
+ `col_156` tinyint(1) default NULL,
+ `col_157` tinyint(1) default NULL,
+ `col_158` tinyint(1) default NULL,
+ `col_159` tinyint(1) default NULL,
+ `col_160` tinyint(1) default NULL,
+ `col_161` tinyint(1) default NULL,
+ `col_162` tinyint(1) default NULL,
+ `col_163` tinyint(1) default NULL,
+ `col_164` tinyint(1) default NULL,
+ `col_165` tinyint(1) default NULL,
+ `col_166` tinyint(1) default NULL,
+ `col_167` tinyint(1) default NULL,
+ `col_168` tinyint(1) default NULL,
+ `col_169` tinyint(1) default NULL,
+ `col_170` tinyint(1) default NULL,
+ `col_171` tinyint(1) default NULL,
+ `col_172` tinyint(1) default NULL,
+ `col_173` tinyint(1) default NULL,
+ `col_174` tinyint(1) default NULL,
+ `col_175` tinyint(1) default NULL,
+ `col_176` tinyint(1) default NULL,
+ `col_177` tinyint(1) default NULL,
+ `col_178` tinyint(1) default NULL,
+ `col_179` tinyint(1) default NULL,
+ `col_180` tinyint(1) default NULL,
+ `col_181` tinyint(1) default NULL,
+ `col_182` tinyint(1) default NULL,
+ `col_183` tinyint(1) default NULL,
+ `col_184` tinyint(1) default NULL,
+ `col_185` tinyint(1) default NULL,
+ `col_186` tinyint(1) default NULL,
+ `col_187` tinyint(1) default NULL,
+ `col_188` tinyint(1) default NULL,
+ `col_189` tinyint(1) default NULL,
+ `col_190` tinyint(1) default NULL,
+ `col_191` tinyint(1) default NULL,
+ `col_192` tinyint(1) default NULL,
+ `col_193` tinyint(1) default NULL,
+ `col_194` tinyint(1) default NULL,
+ `col_195` tinyint(1) default NULL,
+ `col_196` tinyint(1) default NULL,
+ `col_197` tinyint(1) default NULL,
+ `col_198` tinyint(1) default NULL,
+ `col_199` tinyint(1) default NULL,
+ `col_200` tinyint(1) default NULL,
+ `col_201` tinyint(1) default NULL,
+ `col_202` tinyint(1) default NULL,
+ `col_203` tinyint(1) default NULL,
+ `col_204` tinyint(1) default NULL,
+ `col_205` tinyint(1) default NULL,
+ `col_206` tinyint(1) default NULL,
+ `col_207` tinyint(1) default NULL,
+ `col_208` tinyint(1) default NULL,
+ `col_209` tinyint(1) default NULL,
+ `col_210` tinyint(1) default NULL,
+ `col_211` tinyint(1) default NULL,
+ `col_212` tinyint(1) default NULL,
+ `col_213` tinyint(1) default NULL,
+ `col_214` tinyint(1) default NULL,
+ `col_215` tinyint(1) default NULL,
+ `col_216` tinyint(1) default NULL,
+ `col_217` tinyint(1) default NULL,
+ `col_218` tinyint(1) default NULL,
+ `col_219` tinyint(1) default NULL,
+ `col_220` tinyint(1) default NULL,
+ `col_221` tinyint(1) default NULL,
+ `col_222` tinyint(1) default NULL,
+ `col_223` tinyint(1) default NULL,
+ `col_224` tinyint(1) default NULL,
+ `col_225` tinyint(1) default NULL,
+ `col_226` tinyint(1) default NULL,
+ `col_227` tinyint(1) default NULL,
+ `col_228` tinyint(1) default NULL,
+ `col_229` tinyint(1) default NULL,
+ `col_230` tinyint(1) default NULL,
+ `col_231` tinyint(1) default NULL,
+ `col_232` tinyint(1) default NULL,
+ `col_233` tinyint(1) default NULL,
+ `col_234` tinyint(1) default NULL,
+ `col_235` tinyint(1) default NULL,
+ `col_236` tinyint(1) default NULL,
+ `col_237` tinyint(1) default NULL,
+ `col_238` tinyint(1) default NULL,
+ `col_239` tinyint(1) default NULL,
+ `col_240` tinyint(1) default NULL,
+ `col_241` tinyint(1) default NULL,
+ `col_242` tinyint(1) default NULL,
+ `col_243` tinyint(1) default NULL,
+ `col_244` tinyint(1) default NULL,
+ `col_245` tinyint(1) default NULL,
+ `col_246` tinyint(1) default NULL,
+ `col_247` tinyint(1) default NULL,
+ `col_248` tinyint(1) default NULL,
+ `col_249` tinyint(1) default NULL,
+ `col_250` tinyint(1) default NULL,
+ `col_251` tinyint(1) default NULL,
+ `col_252` tinyint(1) default NULL,
+ `col_253` tinyint(1) default NULL,
+ `col_254` tinyint(1) default NULL,
+ `col_255` tinyint(1) default NULL,
+ `col_256` tinyint(1) default NULL,
+ `col_257` tinyint(1) default NULL,
+ `col_258` tinyint(1) default NULL,
+ `col_259` tinyint(1) default NULL,
+ `col_260` tinyint(1) default NULL,
+ `col_261` tinyint(1) default NULL,
+ `col_262` tinyint(1) default NULL,
+ `col_263` tinyint(1) default NULL,
+ `col_264` tinyint(1) default NULL,
+ `col_265` tinyint(1) default NULL,
+ `col_266` tinyint(1) default NULL,
+ `col_267` tinyint(1) default NULL,
+ `col_268` tinyint(1) default NULL,
+ `col_269` tinyint(1) default NULL,
+ `col_270` tinyint(1) default NULL,
+ `col_271` tinyint(1) default NULL,
+ `col_272` tinyint(1) default NULL,
+ `col_273` tinyint(1) default NULL,
+ `col_274` tinyint(1) default NULL,
+ `col_275` tinyint(1) default NULL,
+ `col_276` tinyint(1) default NULL,
+ `col_277` tinyint(1) default NULL,
+ `col_278` tinyint(1) default NULL,
+ `col_279` tinyint(1) default NULL,
+ `col_280` tinyint(1) default NULL,
+ `col_281` tinyint(1) default NULL,
+ `col_282` tinyint(1) default NULL,
+ `col_283` tinyint(1) default NULL,
+ `col_284` tinyint(1) default NULL,
+ `col_285` tinyint(1) default NULL,
+ `col_286` tinyint(1) default NULL,
+ `col_287` tinyint(1) default NULL,
+ `col_288` tinyint(1) default NULL,
+ `col_289` tinyint(1) default NULL,
+ `col_290` tinyint(1) default NULL,
+ `col_291` tinyint(1) default NULL,
+ `col_292` tinyint(1) default NULL,
+ `col_293` tinyint(1) default NULL,
+ `col_294` tinyint(1) default NULL,
+ `col_295` tinyint(1) default NULL,
+ `col_296` tinyint(1) default NULL,
+ `col_297` tinyint(1) default NULL,
+ `col_298` tinyint(1) default NULL,
+ `col_299` tinyint(1) default NULL,
+ `col_300` tinyint(1) default NULL,
+ `col_301` tinyint(1) default NULL,
+ `col_302` tinyint(1) default NULL,
+ `col_303` tinyint(1) default NULL,
+ `col_304` tinyint(1) default NULL,
+ `col_305` tinyint(1) default NULL,
+ `col_306` tinyint(1) default NULL,
+ `col_307` tinyint(1) default NULL,
+ `col_308` tinyint(1) default NULL,
+ `col_309` tinyint(1) default NULL,
+ `col_310` tinyint(1) default NULL,
+ `col_311` tinyint(1) default NULL,
+ `col_312` tinyint(1) default NULL,
+ `col_313` tinyint(1) default NULL,
+ `col_314` tinyint(1) default NULL,
+ `col_315` tinyint(1) default NULL,
+ `col_316` tinyint(1) default NULL,
+ `col_317` tinyint(1) default NULL,
+ `col_318` tinyint(1) default NULL,
+ `col_319` tinyint(1) default NULL,
+ `col_320` tinyint(1) default NULL,
+ `col_321` tinyint(1) default NULL,
+ `col_322` tinyint(1) default NULL,
+ `col_323` tinyint(1) default NULL,
+ `col_324` tinyint(1) default NULL,
+ `col_325` tinyint(1) default NULL,
+ `col_326` tinyint(1) default NULL,
+ `col_327` tinyint(1) default NULL,
+ `col_328` tinyint(1) default NULL,
+ `col_329` tinyint(1) default NULL,
+ `col_330` tinyint(1) default NULL,
+ `col_331` tinyint(1) default NULL,
+ `col_332` tinyint(1) default NULL,
+ `col_333` tinyint(1) default NULL,
+ `col_334` tinyint(1) default NULL,
+ `col_335` tinyint(1) default NULL,
+ `col_336` tinyint(1) default NULL,
+ `col_337` tinyint(1) default NULL,
+ `col_338` tinyint(1) default NULL,
+ `col_339` tinyint(1) default NULL,
+ `col_340` tinyint(1) default NULL,
+ `col_341` tinyint(1) default NULL,
+ `col_342` tinyint(1) default NULL,
+ `col_343` tinyint(1) default NULL,
+ `col_344` tinyint(1) default NULL,
+ `col_345` tinyint(1) default NULL,
+ `col_346` tinyint(1) default NULL,
+ `col_347` tinyint(1) default NULL,
+ `col_348` tinyint(1) default NULL,
+ `col_349` tinyint(1) default NULL,
+ `col_350` tinyint(1) default NULL,
+ `col_351` tinyint(1) default NULL,
+ `col_352` tinyint(1) default NULL,
+ `col_353` tinyint(1) default NULL,
+ `col_354` tinyint(1) default NULL,
+ `col_355` tinyint(1) default NULL,
+ `col_356` tinyint(1) default NULL,
+ `col_357` tinyint(1) default NULL,
+ `col_358` tinyint(1) default NULL,
+ `col_359` tinyint(1) default NULL,
+ `col_360` tinyint(1) default NULL,
+ `col_361` tinyint(1) default NULL,
+ `col_362` tinyint(1) default NULL,
+ `col_363` tinyint(1) default NULL,
+ `col_364` tinyint(1) default NULL,
+ `col_365` tinyint(1) default NULL,
+ `col_366` tinyint(1) default NULL,
+ `col_367` tinyint(1) default NULL,
+ `col_368` tinyint(1) default NULL,
+ `col_369` tinyint(1) default NULL,
+ `col_370` tinyint(1) default NULL,
+ `col_371` tinyint(1) default NULL,
+ `col_372` tinyint(1) default NULL,
+ `col_373` tinyint(1) default NULL,
+ `col_374` tinyint(1) default NULL,
+ `col_375` tinyint(1) default NULL,
+ `col_376` tinyint(1) default NULL,
+ `col_377` tinyint(1) default NULL,
+ `col_378` tinyint(1) default NULL,
+ `col_379` tinyint(1) default NULL,
+ `col_380` tinyint(1) default NULL,
+ `col_381` tinyint(1) default NULL,
+ `col_382` tinyint(1) default NULL,
+ `col_383` tinyint(1) default NULL,
+ `col_384` tinyint(1) default NULL,
+ `col_385` tinyint(1) default NULL,
+ `col_386` tinyint(1) default NULL,
+ `col_387` tinyint(1) default NULL,
+ `col_388` tinyint(1) default NULL,
+ `col_389` tinyint(1) default NULL,
+ `col_390` tinyint(1) default NULL,
+ `col_391` tinyint(1) default NULL,
+ `col_392` tinyint(1) default NULL,
+ `col_393` tinyint(1) default NULL,
+ `col_394` tinyint(1) default NULL,
+ `col_395` tinyint(1) default NULL,
+ `col_396` tinyint(1) default NULL,
+ `col_397` tinyint(1) default NULL,
+ `col_398` tinyint(1) default NULL,
+ `col_399` tinyint(1) default NULL,
+ `col_400` tinyint(1) default NULL,
+ `col_401` tinyint(1) default NULL,
+ `col_402` tinyint(1) default NULL,
+ `col_403` tinyint(1) default NULL,
+ `col_404` tinyint(1) default NULL,
+ `col_405` tinyint(1) default NULL,
+ `col_406` tinyint(1) default NULL,
+ `col_407` tinyint(1) default NULL,
+ `col_408` tinyint(1) default NULL,
+ `col_409` tinyint(1) default NULL,
+ `col_410` tinyint(1) default NULL,
+ `col_411` tinyint(1) default NULL,
+ `col_412` tinyint(1) default NULL,
+ `col_413` tinyint(1) default NULL,
+ `col_414` tinyint(1) default NULL,
+ `col_415` tinyint(1) default NULL,
+ `col_416` tinyint(1) default NULL,
+ `col_417` tinyint(1) default NULL,
+ `col_418` tinyint(1) default NULL,
+ `col_419` tinyint(1) default NULL,
+ `col_420` tinyint(1) default NULL,
+ `col_421` tinyint(1) default NULL,
+ `col_422` tinyint(1) default NULL,
+ `col_423` tinyint(1) default NULL,
+ `col_424` tinyint(1) default NULL,
+ `col_425` tinyint(1) default NULL,
+ `col_426` tinyint(1) default NULL,
+ `col_427` tinyint(1) default NULL,
+ `col_428` tinyint(1) default NULL,
+ `col_429` tinyint(1) default NULL,
+ `col_430` tinyint(1) default NULL,
+ `col_431` tinyint(1) default NULL,
+ `col_432` tinyint(1) default NULL,
+ `col_433` tinyint(1) default NULL,
+ `col_434` tinyint(1) default NULL,
+ `col_435` tinyint(1) default NULL,
+ `col_436` tinyint(1) default NULL,
+ `col_437` tinyint(1) default NULL,
+ `col_438` tinyint(1) default NULL,
+ `col_439` tinyint(1) default NULL,
+ `col_440` tinyint(1) default NULL,
+ `col_441` tinyint(1) default NULL,
+ `col_442` tinyint(1) default NULL,
+ `col_443` tinyint(1) default NULL,
+ `col_444` tinyint(1) default NULL,
+ `col_445` tinyint(1) default NULL,
+ `col_446` tinyint(1) default NULL,
+ `col_447` tinyint(1) default NULL,
+ `col_448` tinyint(1) default NULL,
+ `col_449` tinyint(1) default NULL,
+ `col_450` tinyint(1) default NULL,
+ `col_451` tinyint(1) default NULL,
+ `col_452` tinyint(1) default NULL,
+ `col_453` tinyint(1) default NULL,
+ `col_454` tinyint(1) default NULL,
+ `col_455` tinyint(1) default NULL,
+ `col_456` tinyint(1) default NULL,
+ `col_457` tinyint(1) default NULL,
+ `col_458` tinyint(1) default NULL,
+ `col_459` tinyint(1) default NULL,
+ `col_460` tinyint(1) default NULL,
+ `col_461` tinyint(1) default NULL,
+ `col_462` tinyint(1) default NULL,
+ `col_463` tinyint(1) default NULL,
+ `col_464` tinyint(1) default NULL,
+ `col_465` tinyint(1) default NULL,
+ `col_466` tinyint(1) default NULL,
+ `col_467` tinyint(1) default NULL,
+ `col_468` tinyint(1) default NULL,
+ `col_469` tinyint(1) default NULL,
+ `col_470` tinyint(1) default NULL,
+ `col_471` tinyint(1) default NULL,
+ `col_472` tinyint(1) default NULL,
+ `col_473` tinyint(1) default NULL,
+ `col_474` tinyint(1) default NULL,
+ `col_475` tinyint(1) default NULL,
+ `col_476` tinyint(1) default NULL,
+ `col_477` tinyint(1) default NULL,
+ `col_478` tinyint(1) default NULL,
+ `col_479` tinyint(1) default NULL,
+ `col_480` tinyint(1) default NULL,
+ `col_481` tinyint(1) default NULL,
+ `col_482` tinyint(1) default NULL,
+ `col_483` tinyint(1) default NULL,
+ `col_484` tinyint(1) default NULL,
+ `col_485` tinyint(1) default NULL,
+ `col_486` tinyint(1) default NULL,
+ `col_487` tinyint(1) default NULL,
+ `col_488` tinyint(1) default NULL,
+ `col_489` tinyint(1) default NULL,
+ `col_490` tinyint(1) default NULL,
+ `col_491` tinyint(1) default NULL,
+ `col_492` tinyint(1) default NULL,
+ `col_493` tinyint(1) default NULL,
+ `col_494` tinyint(1) default NULL,
+ `col_495` tinyint(1) default NULL,
+ `col_496` tinyint(1) default NULL,
+ `col_497` tinyint(1) default NULL,
+ `col_498` tinyint(1) default NULL,
+ `col_499` tinyint(1) default NULL,
+ `col_500` tinyint(1) default NULL,
+ `col_501` tinyint(1) default NULL,
+ `col_502` tinyint(1) default NULL,
+ `col_503` tinyint(1) default NULL,
+ `col_504` tinyint(1) default NULL,
+ `col_505` tinyint(1) default NULL,
+ `col_506` tinyint(1) default NULL,
+ `col_507` tinyint(1) default NULL,
+ `col_508` tinyint(1) default NULL,
+ `col_509` tinyint(1) default NULL,
+ `col_510` tinyint(1) default NULL,
+ `col_511` tinyint(1) default NULL,
+ `col_512` tinyint(1) default NULL,
+ `col_513` tinyint(1) default NULL,
+ `col_514` tinyint(1) default NULL,
+ `col_515` tinyint(1) default NULL,
+ `col_516` tinyint(1) default NULL,
+ `col_517` tinyint(1) default NULL,
+ `col_518` tinyint(1) default NULL,
+ `col_519` tinyint(1) default NULL,
+ `col_520` tinyint(1) default NULL,
+ `col_521` tinyint(1) default NULL,
+ `col_522` tinyint(1) default NULL,
+ `col_523` tinyint(1) default NULL,
+ `col_524` tinyint(1) default NULL,
+ `col_525` tinyint(1) default NULL,
+ `col_526` tinyint(1) default NULL,
+ `col_527` tinyint(1) default NULL,
+ `col_528` tinyint(1) default NULL,
+ `col_529` tinyint(1) default NULL,
+ `col_530` tinyint(1) default NULL,
+ `col_531` tinyint(1) default NULL,
+ `col_532` tinyint(1) default NULL,
+ `col_533` tinyint(1) default NULL,
+ `col_534` tinyint(1) default NULL,
+ `col_535` tinyint(1) default NULL,
+ `col_536` tinyint(1) default NULL,
+ `col_537` tinyint(1) default NULL,
+ `col_538` tinyint(1) default NULL,
+ `col_539` tinyint(1) default NULL,
+ `col_540` tinyint(1) default NULL,
+ `col_541` tinyint(1) default NULL,
+ `col_542` tinyint(1) default NULL,
+ `col_543` tinyint(1) default NULL,
+ `col_544` tinyint(1) default NULL,
+ `col_545` tinyint(1) default NULL,
+ `col_546` tinyint(1) default NULL,
+ `col_547` tinyint(1) default NULL,
+ `col_548` tinyint(1) default NULL,
+ `col_549` tinyint(1) default NULL,
+ `col_550` tinyint(1) default NULL,
+ `col_551` tinyint(1) default NULL,
+ `col_552` tinyint(1) default NULL,
+ `col_553` tinyint(1) default NULL,
+ `col_554` tinyint(1) default NULL,
+ `col_555` tinyint(1) default NULL,
+ `col_556` tinyint(1) default NULL,
+ `col_557` tinyint(1) default NULL,
+ `col_558` tinyint(1) default NULL,
+ `col_559` tinyint(1) default NULL,
+ `col_560` tinyint(1) default NULL,
+ `col_561` tinyint(1) default NULL,
+ `col_562` tinyint(1) default NULL,
+ `col_563` tinyint(1) default NULL,
+ `col_564` tinyint(1) default NULL,
+ `col_565` tinyint(1) default NULL,
+ `col_566` tinyint(1) default NULL,
+ `col_567` tinyint(1) default NULL,
+ `col_568` tinyint(1) default NULL,
+ `col_569` tinyint(1) default NULL,
+ `col_570` tinyint(1) default NULL,
+ `col_571` tinyint(1) default NULL,
+ `col_572` tinyint(1) default NULL,
+ `col_573` tinyint(1) default NULL,
+ `col_574` tinyint(1) default NULL,
+ `col_575` tinyint(1) default NULL,
+ `col_576` tinyint(1) default NULL,
+ `col_577` tinyint(1) default NULL,
+ `col_578` tinyint(1) default NULL,
+ `col_579` tinyint(1) default NULL,
+ `col_580` tinyint(1) default NULL,
+ `col_581` tinyint(1) default NULL,
+ `col_582` tinyint(1) default NULL,
+ `col_583` tinyint(1) default NULL,
+ `col_584` tinyint(1) default NULL,
+ `col_585` tinyint(1) default NULL,
+ `col_586` tinyint(1) default NULL,
+ `col_587` tinyint(1) default NULL,
+ `col_588` tinyint(1) default NULL,
+ `col_589` tinyint(1) default NULL,
+ `col_590` tinyint(1) default NULL,
+ `col_591` tinyint(1) default NULL,
+ `col_592` tinyint(1) default NULL,
+ `col_593` tinyint(1) default NULL,
+ `col_594` tinyint(1) default NULL,
+ `col_595` tinyint(1) default NULL,
+ `col_596` tinyint(1) default NULL,
+ `col_597` tinyint(1) default NULL,
+ `col_598` tinyint(1) default NULL,
+ `col_599` tinyint(1) default NULL,
+ `col_600` tinyint(1) default NULL,
+ `col_601` tinyint(1) default NULL,
+ `col_602` tinyint(1) default NULL,
+ `col_603` tinyint(1) default NULL,
+ `col_604` tinyint(1) default NULL,
+ `col_605` tinyint(1) default NULL,
+ `col_606` tinyint(1) default NULL,
+ `col_607` tinyint(1) default NULL,
+ `col_608` tinyint(1) default NULL,
+ `col_609` tinyint(1) default NULL,
+ `col_610` tinyint(1) default NULL,
+ `col_611` tinyint(1) default NULL,
+ `col_612` tinyint(1) default NULL,
+ `col_613` tinyint(1) default NULL,
+ `col_614` tinyint(1) default NULL,
+ `col_615` tinyint(1) default NULL,
+ `col_616` tinyint(1) default NULL,
+ `col_617` tinyint(1) default NULL,
+ `col_618` tinyint(1) default NULL,
+ `col_619` tinyint(1) default NULL,
+ `col_620` tinyint(1) default NULL,
+ `col_621` tinyint(1) default NULL,
+ `col_622` tinyint(1) default NULL,
+ `col_623` tinyint(1) default NULL,
+ `col_624` tinyint(1) default NULL,
+ `col_625` tinyint(1) default NULL,
+ `col_626` tinyint(1) default NULL,
+ `col_627` tinyint(1) default NULL,
+ `col_628` tinyint(1) default NULL,
+ `col_629` tinyint(1) default NULL,
+ `col_630` tinyint(1) default NULL,
+ `col_631` tinyint(1) default NULL,
+ `col_632` tinyint(1) default NULL,
+ `col_633` tinyint(1) default NULL,
+ `col_634` tinyint(1) default NULL,
+ `col_635` tinyint(1) default NULL,
+ `col_636` tinyint(1) default NULL,
+ `col_637` tinyint(1) default NULL,
+ `col_638` tinyint(1) default NULL,
+ `col_639` tinyint(1) default NULL,
+ `col_640` tinyint(1) default NULL,
+ `col_641` tinyint(1) default NULL,
+ `col_642` tinyint(1) default NULL,
+ `col_643` tinyint(1) default NULL,
+ `col_644` tinyint(1) default NULL,
+ `col_645` tinyint(1) default NULL,
+ `col_646` tinyint(1) default NULL,
+ `col_647` tinyint(1) default NULL,
+ `col_648` tinyint(1) default NULL,
+ `col_649` tinyint(1) default NULL,
+ `col_650` tinyint(1) default NULL,
+ `col_651` tinyint(1) default NULL,
+ `col_652` tinyint(1) default NULL,
+ `col_653` tinyint(1) default NULL,
+ `col_654` tinyint(1) default NULL,
+ `col_655` tinyint(1) default NULL,
+ `col_656` tinyint(1) default NULL,
+ `col_657` tinyint(1) default NULL,
+ `col_658` tinyint(1) default NULL,
+ `col_659` tinyint(1) default NULL,
+ `col_660` tinyint(1) default NULL,
+ `col_661` tinyint(1) default NULL,
+ `col_662` tinyint(1) default NULL,
+ `col_663` tinyint(1) default NULL,
+ `col_664` tinyint(1) default NULL,
+ `col_665` tinyint(1) default NULL,
+ `col_666` tinyint(1) default NULL,
+ `col_667` tinyint(1) default NULL,
+ `col_668` tinyint(1) default NULL,
+ `col_669` tinyint(1) default NULL,
+ `col_670` tinyint(1) default NULL,
+ `col_671` tinyint(1) default NULL,
+ `col_672` tinyint(1) default NULL,
+ `col_673` tinyint(1) default NULL,
+ `col_674` tinyint(1) default NULL,
+ `col_675` tinyint(1) default NULL,
+ `col_676` tinyint(1) default NULL,
+ `col_677` tinyint(1) default NULL,
+ `col_678` tinyint(1) default NULL,
+ `col_679` tinyint(1) default NULL,
+ `col_680` tinyint(1) default NULL,
+ `col_681` tinyint(1) default NULL,
+ `col_682` tinyint(1) default NULL,
+ `col_683` tinyint(1) default NULL,
+ `col_684` tinyint(1) default NULL,
+ `col_685` tinyint(1) default NULL,
+ `col_686` tinyint(1) default NULL,
+ `col_687` tinyint(1) default NULL,
+ `col_688` tinyint(1) default NULL,
+ `col_689` tinyint(1) default NULL,
+ `col_690` tinyint(1) default NULL,
+ `col_691` tinyint(1) default NULL,
+ `col_692` tinyint(1) default NULL,
+ `col_693` tinyint(1) default NULL,
+ `col_694` tinyint(1) default NULL,
+ `col_695` tinyint(1) default NULL,
+ `col_696` tinyint(1) default NULL,
+ `col_697` tinyint(1) default NULL,
+ `col_698` tinyint(1) default NULL,
+ `col_699` tinyint(1) default NULL,
+ `col_700` tinyint(1) default NULL,
+ `col_701` tinyint(1) default NULL,
+ `col_702` tinyint(1) default NULL,
+ `col_703` tinyint(1) default NULL,
+ `col_704` tinyint(1) default NULL,
+ `col_705` tinyint(1) default NULL,
+ `col_706` tinyint(1) default NULL,
+ `col_707` tinyint(1) default NULL,
+ `col_708` tinyint(1) default NULL,
+ `col_709` tinyint(1) default NULL,
+ `col_710` tinyint(1) default NULL,
+ `col_711` tinyint(1) default NULL,
+ `col_712` tinyint(1) default NULL,
+ `col_713` tinyint(1) default NULL,
+ `col_714` tinyint(1) default NULL,
+ `col_715` tinyint(1) default NULL,
+ `col_716` tinyint(1) default NULL,
+ `col_717` tinyint(1) default NULL,
+ `col_718` tinyint(1) default NULL,
+ `col_719` tinyint(1) default NULL,
+ `col_720` tinyint(1) default NULL,
+ `col_721` tinyint(1) default NULL,
+ `col_722` tinyint(1) default NULL,
+ `col_723` tinyint(1) default NULL,
+ `col_724` tinyint(1) default NULL,
+ `col_725` tinyint(1) default NULL,
+ `col_726` tinyint(1) default NULL,
+ `col_727` tinyint(1) default NULL,
+ `col_728` tinyint(1) default NULL,
+ `col_729` tinyint(1) default NULL,
+ `col_730` tinyint(1) default NULL,
+ `col_731` tinyint(1) default NULL,
+ `col_732` tinyint(1) default NULL,
+ `col_733` tinyint(1) default NULL,
+ `col_734` tinyint(1) default NULL,
+ `col_735` tinyint(1) default NULL,
+ `col_736` tinyint(1) default NULL,
+ `col_737` tinyint(1) default NULL,
+ `col_738` tinyint(1) default NULL,
+ `col_739` tinyint(1) default NULL,
+ `col_740` tinyint(1) default NULL,
+ `col_741` tinyint(1) default NULL,
+ `col_742` tinyint(1) default NULL,
+ `col_743` tinyint(1) default NULL,
+ `col_744` tinyint(1) default NULL,
+ `col_745` tinyint(1) default NULL,
+ `col_746` tinyint(1) default NULL,
+ `col_747` tinyint(1) default NULL,
+ `col_748` tinyint(1) default NULL,
+ `col_749` tinyint(1) default NULL,
+ `col_750` tinyint(1) default NULL,
+ `col_751` tinyint(1) default NULL,
+ `col_752` tinyint(1) default NULL,
+ `col_753` tinyint(1) default NULL,
+ `col_754` tinyint(1) default NULL,
+ `col_755` tinyint(1) default NULL,
+ `col_756` tinyint(1) default NULL,
+ `col_757` tinyint(1) default NULL,
+ `col_758` tinyint(1) default NULL,
+ `col_759` tinyint(1) default NULL,
+ `col_760` tinyint(1) default NULL,
+ `col_761` tinyint(1) default NULL,
+ `col_762` tinyint(1) default NULL,
+ `col_763` tinyint(1) default NULL,
+ `col_764` tinyint(1) default NULL,
+ `col_765` tinyint(1) default NULL,
+ `col_766` tinyint(1) default NULL,
+ `col_767` tinyint(1) default NULL,
+ `col_768` tinyint(1) default NULL,
+ `col_769` tinyint(1) default NULL,
+ `col_770` tinyint(1) default NULL,
+ `col_771` tinyint(1) default NULL,
+ `col_772` tinyint(1) default NULL,
+ `col_773` tinyint(1) default NULL,
+ `col_774` tinyint(1) default NULL,
+ `col_775` tinyint(1) default NULL,
+ `col_776` tinyint(1) default NULL,
+ `col_777` tinyint(1) default NULL,
+ `col_778` tinyint(1) default NULL,
+ `col_779` tinyint(1) default NULL,
+ `col_780` tinyint(1) default NULL,
+ `col_781` tinyint(1) default NULL,
+ `col_782` tinyint(1) default NULL,
+ `col_783` tinyint(1) default NULL,
+ `col_784` tinyint(1) default NULL,
+ `col_785` tinyint(1) default NULL,
+ `col_786` tinyint(1) default NULL,
+ `col_787` tinyint(1) default NULL,
+ `col_788` tinyint(1) default NULL,
+ `col_789` tinyint(1) default NULL,
+ `col_790` tinyint(1) default NULL,
+ `col_791` tinyint(1) default NULL,
+ `col_792` tinyint(1) default NULL,
+ `col_793` tinyint(1) default NULL,
+ `col_794` tinyint(1) default NULL,
+ `col_795` tinyint(1) default NULL,
+ `col_796` tinyint(1) default NULL,
+ `col_797` tinyint(1) default NULL,
+ `col_798` tinyint(1) default NULL,
+ `col_799` tinyint(1) default NULL,
+ `col_800` tinyint(1) default NULL,
+ `col_801` tinyint(1) default NULL,
+ `col_802` tinyint(1) default NULL,
+ `col_803` tinyint(1) default NULL,
+ `col_804` tinyint(1) default NULL,
+ `col_805` tinyint(1) default NULL,
+ `col_806` tinyint(1) default NULL,
+ `col_807` tinyint(1) default NULL,
+ `col_808` tinyint(1) default NULL,
+ `col_809` tinyint(1) default NULL,
+ `col_810` tinyint(1) default NULL,
+ `col_811` tinyint(1) default NULL,
+ `col_812` tinyint(1) default NULL,
+ `col_813` tinyint(1) default NULL,
+ `col_814` tinyint(1) default NULL,
+ `col_815` tinyint(1) default NULL,
+ `col_816` tinyint(1) default NULL,
+ `col_817` tinyint(1) default NULL,
+ `col_818` tinyint(1) default NULL,
+ `col_819` tinyint(1) default NULL,
+ `col_820` tinyint(1) default NULL,
+ `col_821` tinyint(1) default NULL,
+ `col_822` tinyint(1) default NULL,
+ `col_823` tinyint(1) default NULL,
+ `col_824` tinyint(1) default NULL,
+ `col_825` tinyint(1) default NULL,
+ `col_826` tinyint(1) default NULL,
+ `col_827` tinyint(1) default NULL,
+ `col_828` tinyint(1) default NULL,
+ `col_829` tinyint(1) default NULL,
+ `col_830` tinyint(1) default NULL,
+ `col_831` tinyint(1) default NULL,
+ `col_832` tinyint(1) default NULL,
+ `col_833` tinyint(1) default NULL,
+ `col_834` tinyint(1) default NULL,
+ `col_835` tinyint(1) default NULL,
+ `col_836` tinyint(1) default NULL,
+ `col_837` tinyint(1) default NULL,
+ `col_838` tinyint(1) default NULL,
+ `col_839` tinyint(1) default NULL,
+ `col_840` tinyint(1) default NULL,
+ `col_841` tinyint(1) default NULL,
+ `col_842` tinyint(1) default NULL,
+ `col_843` tinyint(1) default NULL,
+ `col_844` tinyint(1) default NULL,
+ `col_845` tinyint(1) default NULL,
+ `col_846` tinyint(1) default NULL,
+ `col_847` tinyint(1) default NULL,
+ `col_848` tinyint(1) default NULL,
+ `col_849` tinyint(1) default NULL,
+ `col_850` tinyint(1) default NULL,
+ `col_851` tinyint(1) default NULL,
+ `col_852` tinyint(1) default NULL,
+ `col_853` tinyint(1) default NULL,
+ `col_854` tinyint(1) default NULL,
+ `col_855` tinyint(1) default NULL,
+ `col_856` tinyint(1) default NULL,
+ `col_857` tinyint(1) default NULL,
+ `col_858` tinyint(1) default NULL,
+ `col_859` tinyint(1) default NULL,
+ `col_860` tinyint(1) default NULL,
+ `col_861` tinyint(1) default NULL,
+ `col_862` tinyint(1) default NULL,
+ `col_863` tinyint(1) default NULL,
+ `col_864` tinyint(1) default NULL,
+ `col_865` tinyint(1) default NULL,
+ `col_866` tinyint(1) default NULL,
+ `col_867` tinyint(1) default NULL,
+ `col_868` tinyint(1) default NULL,
+ `col_869` tinyint(1) default NULL,
+ `col_870` tinyint(1) default NULL,
+ `col_871` tinyint(1) default NULL,
+ `col_872` tinyint(1) default NULL,
+ `col_873` tinyint(1) default NULL,
+ `col_874` tinyint(1) default NULL,
+ `col_875` tinyint(1) default NULL,
+ `col_876` tinyint(1) default NULL,
+ `col_877` tinyint(1) default NULL,
+ `col_878` tinyint(1) default NULL,
+ `col_879` tinyint(1) default NULL,
+ `col_880` tinyint(1) default NULL,
+ `col_881` tinyint(1) default NULL,
+ `col_882` tinyint(1) default NULL,
+ `col_883` tinyint(1) default NULL,
+ `col_884` tinyint(1) default NULL,
+ `col_885` tinyint(1) default NULL,
+ `col_886` tinyint(1) default NULL,
+ `col_887` tinyint(1) default NULL,
+ `col_888` tinyint(1) default NULL,
+ `col_889` tinyint(1) default NULL,
+ `col_890` tinyint(1) default NULL,
+ `col_891` tinyint(1) default NULL,
+ `col_892` tinyint(1) default NULL,
+ `col_893` tinyint(1) default NULL,
+ `col_894` tinyint(1) default NULL,
+ `col_895` tinyint(1) default NULL,
+ `col_896` tinyint(1) default NULL,
+ `col_897` tinyint(1) default NULL,
+ `col_898` tinyint(1) default NULL,
+ `col_899` tinyint(1) default NULL,
+ `col_900` tinyint(1) default NULL,
+ `col_901` tinyint(1) default NULL,
+ `col_902` tinyint(1) default NULL,
+ `col_903` tinyint(1) default NULL,
+ `col_904` tinyint(1) default NULL,
+ `col_905` tinyint(1) default NULL,
+ `col_906` tinyint(1) default NULL,
+ `col_907` tinyint(1) default NULL,
+ `col_908` tinyint(1) default NULL,
+ `col_909` tinyint(1) default NULL,
+ `col_910` tinyint(1) default NULL,
+ `col_911` tinyint(1) default NULL,
+ `col_912` tinyint(1) default NULL,
+ `col_913` tinyint(1) default NULL,
+ `col_914` tinyint(1) default NULL,
+ `col_915` tinyint(1) default NULL,
+ `col_916` tinyint(1) default NULL,
+ `col_917` tinyint(1) default NULL,
+ `col_918` tinyint(1) default NULL,
+ `col_919` tinyint(1) default NULL,
+ `col_920` tinyint(1) default NULL,
+ `col_921` tinyint(1) default NULL,
+ `col_922` tinyint(1) default NULL,
+ `col_923` tinyint(1) default NULL,
+ `col_924` tinyint(1) default NULL,
+ `col_925` tinyint(1) default NULL,
+ `col_926` tinyint(1) default NULL,
+ `col_927` tinyint(1) default NULL,
+ `col_928` tinyint(1) default NULL,
+ `col_929` tinyint(1) default NULL,
+ `col_930` tinyint(1) default NULL,
+ `col_931` tinyint(1) default NULL,
+ `col_932` tinyint(1) default NULL,
+ `col_933` tinyint(1) default NULL,
+ `col_934` tinyint(1) default NULL,
+ `col_935` tinyint(1) default NULL,
+ `col_936` tinyint(1) default NULL,
+ `col_937` tinyint(1) default NULL,
+ `col_938` tinyint(1) default NULL,
+ `col_939` tinyint(1) default NULL,
+ `col_940` tinyint(1) default NULL,
+ `col_941` tinyint(1) default NULL,
+ `col_942` tinyint(1) default NULL,
+ `col_943` tinyint(1) default NULL,
+ `col_944` tinyint(1) default NULL,
+ `col_945` tinyint(1) default NULL,
+ `col_946` tinyint(1) default NULL,
+ `col_947` tinyint(1) default NULL,
+ `col_948` tinyint(1) default NULL,
+ `col_949` tinyint(1) default NULL,
+ `col_950` tinyint(1) default NULL,
+ `col_951` tinyint(1) default NULL,
+ `col_952` tinyint(1) default NULL,
+ `col_953` tinyint(1) default NULL,
+ `col_954` tinyint(1) default NULL,
+ `col_955` tinyint(1) default NULL,
+ `col_956` tinyint(1) default NULL,
+ `col_957` tinyint(1) default NULL,
+ `col_958` tinyint(1) default NULL,
+ `col_959` tinyint(1) default NULL,
+ `col_960` tinyint(1) default NULL,
+ `col_961` tinyint(1) default NULL,
+ `col_962` tinyint(1) default NULL,
+ `col_963` tinyint(1) default NULL,
+ `col_964` tinyint(1) default NULL,
+ `col_965` tinyint(1) default NULL,
+ `col_966` tinyint(1) default NULL,
+ `col_967` tinyint(1) default NULL,
+ `col_968` tinyint(1) default NULL,
+ `col_969` tinyint(1) default NULL,
+ `col_970` tinyint(1) default NULL,
+ `col_971` tinyint(1) default NULL,
+ `col_972` tinyint(1) default NULL,
+ `col_973` tinyint(1) default NULL,
+ `col_974` tinyint(1) default NULL,
+ `col_975` tinyint(1) default NULL,
+ `col_976` tinyint(1) default NULL,
+ `col_977` tinyint(1) default NULL,
+ `col_978` tinyint(1) default NULL,
+ `col_979` tinyint(1) default NULL,
+ `col_980` tinyint(1) default NULL,
+ `col_981` tinyint(1) default NULL,
+ `col_982` tinyint(1) default NULL,
+ `col_983` tinyint(1) default NULL,
+ `col_984` tinyint(1) default NULL,
+ `col_985` tinyint(1) default NULL,
+ `col_986` tinyint(1) default NULL,
+ `col_987` tinyint(1) default NULL,
+ `col_988` tinyint(1) default NULL,
+ `col_989` tinyint(1) default NULL,
+ `col_990` tinyint(1) default NULL,
+ `col_991` tinyint(1) default NULL,
+ `col_992` tinyint(1) default NULL,
+ `col_993` tinyint(1) default NULL,
+ `col_994` tinyint(1) default NULL,
+ `col_995` tinyint(1) default NULL,
+ `col_996` tinyint(1) default NULL,
+ `col_997` tinyint(1) default NULL,
+ `col_998` tinyint(1) default NULL,
+ `col_999` tinyint(1) default NULL,
+ `col_1000` tinyint(1) default NULL,
+ `col_1001` tinyint(1) default NULL,
+ `col_1002` tinyint(1) default NULL,
+ `col_1003` tinyint(1) default NULL,
+ `col_1004` tinyint(1) default NULL,
+ `col_1005` tinyint(1) default NULL,
+ `col_1006` tinyint(1) default NULL,
+ `col_1007` tinyint(1) default NULL,
+ `col_1008` tinyint(1) default NULL,
+ `col_1009` tinyint(1) default NULL,
+ `col_1010` tinyint(1) default NULL,
+ `col_1011` tinyint(1) default NULL,
+ `col_1012` tinyint(1) default NULL,
+ `col_1013` tinyint(1) default NULL,
+ `col_1014` tinyint(1) default NULL,
+ `col_1015` tinyint(1) default NULL,
+ `col_1016` tinyint(1) default NULL,
+ `col_1017` tinyint(1) default NULL,
+ `col_1018` tinyint(1) default NULL,
+ `col_1019` tinyint(1) default NULL,
+ `col_1020` tinyint(1) default NULL,
+ `col_1021` tinyint(1) default NULL,
+ `col_1022` tinyint(1) default NULL,
+ `col_1023` tinyint(1) default NULL,
+ `col_1024` tinyint(1) default NULL,
+ `col_1025` tinyint(1) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+--enable_query_log
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+INSERT INTO t1 VALUES();
+SELECT COUNT(*) FROM v1;
+
+--exec $MYSQL_DUMP --allow-keywords --single-transaction --quick --verbose test --result-file $MYSQLTEST_VARDIR/tmp/bug31434.sql
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug31434.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31434.sql
+
+SELECT COUNT(*) FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+SET GLOBAL storage_engine=@old_engine;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 0318935de40..28e3439b960 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -5,6 +5,14 @@
# Binlog is required
--source include/have_log_bin.inc
+
+--echo Bug#37938 - Test "mysqldump" lacks various insert statements
+--echo Turn off concurrent inserts to avoid random errors
+--echo NOTE: We reset the variable back to saved value at the end of test
+SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
+SET @@GLOBAL.CONCURRENT_INSERT = 0;
+
+
--disable_warnings
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
drop database if exists mysqldump_test_db;
@@ -1593,6 +1601,7 @@ DROP TABLE t1,t2;
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
--exec $MYSQL_DUMP test
+
--echo #
--echo # End of 5.0 tests
--echo #
@@ -1859,6 +1868,10 @@ DROP DATABASE mysqldump_test_db;
--echo # -- End of test case for Bug#32538.
--echo
+# We reset concurrent_inserts value to whatever it was at the start of the test
+SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
+
+
###########################################################################
--echo #
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index bf4cc37a80f..f09c1aa7bd4 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -847,6 +847,26 @@ set session max_sort_length= 2180;
select * from t1 order by b;
drop table t1;
+
+--echo #
+--echo # Bug #39844: Query Crash Mysql Server 5.0.67
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+CREATE TABLE t3 (c INT);
+
+INSERT INTO t1 (a) VALUES (1), (2);
+INSERT INTO t2 (a,b) VALUES (1,2), (2,3);
+INSERT INTO t3 (c) VALUES (1), (2);
+
+SELECT
+ (SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
+ FROM t3;
+
+DROP TABLE t1, t2, t3;
+
+
#
# Bug #35206: select query result different if the key is indexed or not
#
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 2b80b0b9d93..527a4d398d8 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -31,13 +31,13 @@ select load_file(concat(@tmpdir,"/outfile-test.3"));
# the following should give errors
disable_query_log;
---error 1086
+--error ER_FILE_EXISTS_ERROR
eval select * into outfile "../tmp/outfile-test.1" from t1;
---error 1086
+--error ER_FILE_EXISTS_ERROR
eval select * into dumpfile "../tmp/outfile-test.2" from t1;
---error 1086
+--error ER_FILE_EXISTS_ERROR
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
@@ -92,7 +92,7 @@ use test;
# It should not be possible to write to a file outside of vardir
create table t1(a int);
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT
eval select * into outfile "$MYSQL_TEST_DIR/outfile-test1" from t1;
drop table t1;
@@ -105,7 +105,7 @@ create user user_1@localhost;
grant all on mysqltest.* to user_1@localhost;
connect (con28181_1,localhost,user_1,,mysqltest);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
eval select schema_name
into outfile "../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
@@ -125,7 +125,7 @@ from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost;
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 5270eced05f..e8df2b01a94 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -15,6 +15,35 @@ drop table if exists t1, t2;
--enable_warnings
#
+# Bug#40494: Crash MYSQL server crashes on range access with partitioning
+# and order by
+#
+CREATE TABLE t1 (a INT NOT NULL, KEY(a))
+PARTITION BY RANGE(a)
+(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (2), (40), (40), (70), (60), (90), (199);
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95 ORDER BY a ASC;
+--sorted_result
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95;
+INSERT INTO t1 VALUES (200), (250), (210);
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220 ORDER BY a ASC;
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220 ORDER BY a ASC;
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95 ORDER BY a DESC;
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220 ORDER BY a DESC;
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220 ORDER BY a DESC;
+--sorted_result
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220;
+--sorted_result
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220;
+--sorted_result
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 95;
+--sorted_result
+SELECT a FROM t1 WHERE a BETWEEN 60 AND 220;
+--sorted_result
+SELECT a FROM t1 WHERE a BETWEEN 200 AND 220;
+DROP TABLE t1;
+
+#
# Bug35931: Index search may return duplicates
#
CREATE TABLE t1 (
@@ -120,7 +149,10 @@ CREATE TABLE `t1` (
CREATE TABLE `t2` (
`c1` int(11) DEFAULT NULL,
KEY `c1` (`c1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (c1)
+(PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM,
+ PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
@@ -1589,13 +1621,15 @@ drop table t;
#
USE mysql;
+TRUNCATE TABLE general_log;
+SET @old_general_log_state = @@global.general_log;
SET GLOBAL general_log = 0;
ALTER TABLE general_log ENGINE = MyISAM;
--error ER_WRONG_USAGE
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
ALTER TABLE general_log ENGINE = CSV;
-SET GLOBAL general_log = default;
+SET GLOBAL general_log = @old_general_log_state;
use test;
#
@@ -1791,4 +1825,76 @@ select count(*) from t1, t2 where t1.createdDate = t2.createdDate;
drop table t1, t2;
+#
+# Bug #38083 Error-causing row inserted into partitioned table despite error
+#
+SET @orig_sql_mode = @@SQL_MODE;
+SET SQL_MODE='STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
+CREATE TABLE t1 (c1 INT)
+ PARTITION BY LIST(1 DIV c1) (
+ PARTITION p0 VALUES IN (NULL),
+ PARTITION p1 VALUES IN (1)
+ );
+
+-- error ER_DIVISION_BY_ZERO
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+TRUNCATE t1;
+-- error ER_DIVISION_BY_ZERO
+INSERT INTO t1 VALUES (NULL), (0), (1), (2);
+SELECT * FROM t1;
+DROP TABLE t1;
+SET SQL_MODE= @orig_sql_mode;
+
+
+
+#
+# Bug #38005 Partitions: error with insert select
+#
+
+create table t1 (s1 int) partition by hash(s1) partitions 2;
+create index i on t1 (s1);
+insert into t1 values (1);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+select * from t1;
+drop table t1;
+
+create table t1 (s1 int) partition by range(s1)
+ (partition pa1 values less than (10),
+ partition pa2 values less than MAXVALUE);
+create index i on t1 (s1);
+insert into t1 values (1);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+select * from t1;
+drop table t1;
+
+create table t1 (s1 int) partition by range(s1)
+ (partition pa1 values less than (10),
+ partition pa2 values less than MAXVALUE);
+create index i on t1 (s1);
+insert into t1 values (20);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+select * from t1;
+drop table t1;
+
+create table t1 (s1 int) partition by range(s1)
+ (partition pa1 values less than (10),
+ partition pa2 values less than MAXVALUE);
+create index i on t1 (s1);
+insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8);
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1;
+insert into t1 select s1 from t1 order by s1 desc;
+insert into t1 select s1 from t1 where s1=3;
+select count(*) from t1;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 932855cc877..c29b3458d19 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -1,6 +1,46 @@
--source include/have_partition.inc
--source include/have_innodb.inc
+#
+# Bug37721: ORDER BY when WHERE contains non-partitioned index column
+# wrong order since it did not use pk as second compare
+--echo # Bug#37721, test of ORDER BY on PK and WHERE on INDEX
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ PRIMARY KEY (a),
+ INDEX (b))
+ENGINE InnoDB
+PARTITION BY HASH(a)
+PARTITIONS 3;
+# This will give the middle partition the highest value
+INSERT INTO t1 VALUES (0,0),(4,0),(2,0);
+SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
+SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
+ALTER TABLE t1 DROP INDEX b;
+SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
+SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
+DROP TABLE t1;
+CREATE TABLE t1 (
+ a VARCHAR(600),
+ b VARCHAR(600),
+ PRIMARY KEY (a),
+ INDEX (b))
+ENGINE InnoDB
+PARTITION BY KEY(a)
+PARTITIONS 3;
+# This will give the middle partition the highest value
+INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'1'),repeat('0',257));
+INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'3'),repeat('0',257));
+INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'2'),repeat('0',257));
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
+ALTER TABLE t1 DROP INDEX b;
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
+SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
+DROP TABLE t1;
+
+#
# Bug#32948 - FKs allowed to reference partitioned table
#
-- echo # Bug#32948
diff --git a/mysql-test/t/partition_innodb_stmt.test b/mysql-test/t/partition_innodb_stmt.test
new file mode 100644
index 00000000000..2ed5baee0ac
--- /dev/null
+++ b/mysql-test/t/partition_innodb_stmt.test
@@ -0,0 +1,59 @@
+--source include/have_binlog_format_statement.inc
+--source include/have_innodb.inc
+
+--echo # connection default
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+
+CREATE TABLE t1
+(
+ id SMALLINT NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=innodb
+PARTITION BY RANGE (id)
+(
+ PARTITION p1 VALUES LESS THAN (2),
+ PARTITION p2 VALUES LESS THAN (4),
+ PARTITION p3 VALUES LESS THAN (10)
+);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+
+--echo # Test READ COMMITTED -> REPEATABLE READ
+FLUSH TABLES;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+BEGIN;
+SELECT * FROM t1;
+
+connect (con1, localhost, root,,);
+connection con1;
+
+--echo #connection con1
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+BEGIN;
+INSERT INTO t1 VALUES(7);
+COMMIT;
+
+connection default;
+--echo # connection default
+COMMIT;
+
+FLUSH TABLES;
+
+--echo # Test REPEATABLE READ -> READ COMMITTED
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+BEGIN;
+SELECT * FROM t1;
+
+connection con1;
+
+--echo # connection con1
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+BEGIN;
+--error ER_BINLOG_LOGGING_IMPOSSIBLE
+INSERT INTO t1 VALUES(9);
+COMMIT;
+
+disconnect con1;
+connection default;
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 68da4a5b390..524a2e04b25 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -52,3 +52,27 @@ alter table t1 REORGANIZE partition p1 INTO
partition p12 values in (3,4));
drop table t1;
+#
+# Verification tests for bug#14326
+#
+--error ER_PARSE_ERROR
+CREATE TABLE t1 (a INT)
+/*!50100 PARTITION BY HASH (a)
+/* Test
+ of multi-line
+ comment */
+PARTITIONS 5 */;
+CREATE TABLE t1 (a INT)
+/*!50100 PARTITION BY HASH (a)
+-- with a single line comment embedded
+PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_mgm_err.test b/mysql-test/t/partition_mgm_err.test
index 8573fd59f2f..0f8b8d3cd90 100644
--- a/mysql-test/t/partition_mgm_err.test
+++ b/mysql-test/t/partition_mgm_err.test
@@ -125,6 +125,18 @@ ALTER TABLE t1 DROP PARTITION x1;
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
ALTER TABLE t1 COALESCE PARTITION 1;
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+ALTER TABLE t1 ANALYZE PARTITION p1;
+
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+ALTER TABLE t1 CHECK PARTITION p1;
+
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
+
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+ALTER TABLE t1 REPAIR PARTITION p1;
+
DROP TABLE t1;
CREATE TABLE t1 (a int)
diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test
index 4814828c9b9..d7108d5af98 100644
--- a/mysql-test/t/partition_not_windows.test
+++ b/mysql-test/t/partition_not_windows.test
@@ -3,8 +3,6 @@
--source include/have_partition.inc
# DATA DIRECTORY/INDEX DIRECTORY require symbolic link support
--source include/have_symlink.inc
-# realpath is not compiled in when building with valgrind
---source include/not_valgrind.inc
# The test for Bug 20770 is disabled on Windows due to BUG#19107; it
# should be moved into partition.test once the bug has been resolved.
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index bc4231d1d71..c02d9049f2e 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -807,24 +807,24 @@ DROP TABLE t1;
#
# BUG#30573: get wrong result with "group by" on PARTITIONed table
#
-#create table t1 (a int);
-#insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-#CREATE TABLE t2 (
-# defid int(10) unsigned NOT NULL,
-# day int(10) unsigned NOT NULL,
-# count int(10) unsigned NOT NULL,
-# filler char(200),
-# KEY (defid,day)
-#)
-#PARTITION BY RANGE (day) (
-# PARTITION p7 VALUES LESS THAN (20070401) ,
-# PARTITION p8 VALUES LESS THAN (20070501));
-
-#insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B;
-#insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B;
-#insert into t2 values(52, 20070321, 123, 'filler') ;
-#insert into t2 values(52, 20070322, 456, 'filler') ;
-
-#select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
-#drop table t1, t2;
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t2 (
+ defid int(10) unsigned NOT NULL,
+ day int(10) unsigned NOT NULL,
+ count int(10) unsigned NOT NULL,
+ filler char(200),
+ KEY (defid,day)
+)
+PARTITION BY RANGE (day) (
+ PARTITION p7 VALUES LESS THAN (20070401) ,
+ PARTITION p8 VALUES LESS THAN (20070501));
+
+insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B;
+insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B;
+insert into t2 values(52, 20070321, 123, 'filler') ;
+insert into t2 values(52, 20070322, 456, 'filler') ;
+
+select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
+drop table t1, t2;
diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test
index 515bcc03c1a..ccab833e878 100644
--- a/mysql-test/t/ps_11bugs.test
+++ b/mysql-test/t/ps_11bugs.test
@@ -177,4 +177,41 @@ select * from t2;
drop table t1;
drop table t2;
+#
+# Bug #32124: crash if prepared statements refer to variables in the where
+# clause
+#
+
+CREATE TABLE t1 (a INT);
+PREPARE stmt FROM 'select 1 from `t1` where `a` = any (select (@@tmpdir))';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (400000), (400001);
+
+SET @@sort_buffer_size=400000;
+
+DELIMITER |;
+
+CREATE FUNCTION p1(i INT) RETURNS INT
+BEGIN
+ SET @@sort_buffer_size= i;
+ RETURN i + 1;
+END|
+
+DELIMITER ;|
+
+SELECT * FROM t2 WHERE a = @@sort_buffer_size AND p1(@@sort_buffer_size + 1) > a - 1;
+
+DROP TABLE t2;
+DROP FUNCTION p1;
+
+
+SELECT CONCAT(@@sort_buffer_size);
+SELECT LEFT("12345", @@ft_boolean_syntax);
+
+SET @@sort_buffer_size=DEFAULT;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/slow_launch_time_func.test b/mysql-test/t/slow_launch_time_func.test
index fe8d1ba4c02..c9a7d28bb8a 100644
--- a/mysql-test/t/slow_launch_time_func.test
+++ b/mysql-test/t/slow_launch_time_func.test
@@ -1,6 +1,6 @@
-############# mysql-test\t\SLOW_LAUNCH_time_func.test ##########################
+############# mysql-test\t\slow_launch_time_func.test ##########################
# #
-# Variable Name: slow_launch_time #
+# Variable Name: slow_launch_time #
# Scope: SESSION #
# Access Type: Dynamic #
# Data Type: NUMERIC #
@@ -9,14 +9,20 @@
# #
# #
# Creation Date: 2008-03-02 #
-# Author: Sharique Abdullah #
+# Author: Sharique Abdullah #
+# #
+# Last change: 2008-09-09 mleich Reimplementation of this test #
+# - Fix Bug#36874 : main.slow_launch_time_func test fails #
+# randomly #
+# - Fix other failures and streamline the test #
# #
# Description: Test Cases of Dynamic System Variable "slow_launch_time " #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
-#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#
-# option_mysqld_slow_launch_time #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# option_mysqld_slow_launch_time #
# #
################################################################################
@@ -28,82 +34,71 @@
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
+--echo ** Connection default **
+connection default;
--echo '#--------------------FN_DYNVARS_124_01-------------------------#'
-#####################################
-# Increase number of connection #
-#####################################
-
---echo ** Connection default **
-connection default;
+########################################################################
+# Reveal that a new connect gets counted as "slow launched thread" if #
+# @@GLOBAL.slow_launch_time = 0. #
+# The value of slow_launch_threads must be increased by 1. #
+########################################################################
SET @@GLOBAL.slow_launch_time=0;
SELECT @@GLOBAL.slow_launch_time;
---echo ** Connecting conn5 using username 'root' **
-CONNECT (conn5,localhost,root,,);
---echo ** Connecting conn6 using username 'root' **
-CONNECT (conn6,localhost,root,,);
---echo ** Connecting conn7 using username 'root' **
-CONNECT (conn7,localhost,root,,);
---echo ** Connecting conn8 using username 'root' **
-CONNECT (conn8,localhost,root,,);
---echo ** Connecting conn9 using username 'root' **
-CONNECT (conn9,localhost,root,,);
---echo ** Connecting conn10 using username 'root' **
-CONNECT (conn10,localhost,root,,);
---echo ** Connecting conn11 using username 'root' **
-CONNECT (conn11,localhost,root,,);
---echo ** Connecting conn12 using username 'root' **
-CONNECT (conn12,localhost,root,,);
---echo ** Connecting conn13 using username 'root' **
-CONNECT (conn13,localhost,root,,);
---echo ** Connecting conn14 using username 'root' **
-CONNECT (conn14,localhost,root,,);
---echo ** Connecting conn15 using username 'root' **
-CONNECT (conn15,localhost,root,,);
---echo ** Connecting conn16 using username 'root' **
-CONNECT (conn16,localhost,root,,);
+let $value_before=
+ query_get_value(show status like 'slow_launch_threads', Value, 1);
+--echo ** Connecting conn1 using username 'root' **
+CONNECT (conn1,localhost,root,,);
+let $value_after=
+ query_get_value(show status like 'slow_launch_threads', Value, 1);
+if (!`SELECT $value_after = $value_before + 1`)
+{
+ --echo ERROR: Subtest FN_DYNVARS_124_01 failed
+ --echo A new connect should be counted as 'slow_launch_thread' if
+ --echo @@GLOBAL.slow_launch_time=0
+ SELECT @@GLOBAL.slow_launch_time;
+ echo Number of slow_launch_threads before new connect: $value_before;
+ echo Number of slow_launch_threads after new connect: $value_after;
+}
+--echo ** Switch to connection default and disconnect conn1 **
+connection default;
+disconnect conn1;
+
+--echo '#--------------------FN_DYNVARS_124_02-------------------------#'
+########################################################################
+# Reveal that a new connect gets not counted as "slow launched thread" #
+# if @@GLOBAL.slow_launch_time is sufficient big. #
+# The value of slow_launch_threads must not change. #
+########################################################################
-#
-# Checking status of slow_launch_threads
-#
+SET @@GLOBAL.slow_launch_time= 1000;
+SELECT @@GLOBAL.slow_launch_time;
-show status like 'slow_launch_threads';
---echo 12 Expected
+let $value_before=
+ query_get_value(show status like 'slow_launch_threads', Value, 1);
+--echo ** Connecting conn2 using username 'root' **
+CONNECT (conn2,localhost,root,,);
+let $value_after=
+ query_get_value(show status like 'slow_launch_threads', Value, 1);
+if (!`SELECT $value_after = $value_before`)
+{
+ --echo ERROR: Subtest FN_DYNVARS_124_02 failed
+ --echo A new connect must not be counted as 'slow_launch_thread' if
+ --echo @@GLOBAL.slow_launch_time is sufficient big.
+ SELECT @@GLOBAL.slow_launch_time;
+ echo Number of slow_launch_threads before new connect: $value_before;
+ echo Number of slow_launch_threads after new connect: $value_after;
+}
#
# Cleanup
#
---echo ** Connection default **
+--echo ** Switch to connection default and disconnect conn2 **
connection default;
-
---echo ** Disconnecting conn5 **
-disconnect conn5;
---echo ** Disconnecting conn6 **
-disconnect conn6;
---echo ** Disconnecting conn7 **
-disconnect conn7;
---echo ** Disconnecting conn8 **
-disconnect conn8;
---echo ** Disconnecting conn9 **
-disconnect conn9;
---echo ** Disconnecting conn10 **
-disconnect conn10;
---echo ** Disconnecting conn11 **
-disconnect conn11;
---echo ** Disconnecting conn12 **
-disconnect conn12;
---echo ** Disconnecting conn13 **
-disconnect conn13;
---echo ** Disconnecting conn14 **
-disconnect conn14;
---echo ** Disconnecting conn15 **
-disconnect conn15;
---echo ** Disconnecting conn16 **
-disconnect conn16;
-
+disconnect conn2;
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 1e329f7fe79..5437f3a156f 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -2362,6 +2362,14 @@ begin
end loop;
end|
+CREATE TABLE t1 (a INT)|
+INSERT INTO t1 VALUES (1),(2)|
+CREATE PROCEDURE p1(a INT) BEGIN END|
+--error ER_SUBQUERY_NO_1_ROW
+CALL p1((SELECT * FROM t1))|
+DROP PROCEDURE IF EXISTS p1|
+DROP TABLE t1|
+
delimiter ;|
#
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 8477211f524..05bccae67aa 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -7997,8 +7997,24 @@ select (select func30787(f1)) as ttt from t1;
drop function func30787;
drop table t1;
-###########################################################################
+#
+# Bug #33811: Call to stored procedure with SELECT * / RIGHT JOIN fails
+# after the first time
+#
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+
+CREATE PROCEDURE test_sp()
+ SELECT t1.* FROM t1 RIGHT JOIN t1 t2 ON t1.id=t2.id;
+
+CALL test_sp();
+CALL test_sp();
+
+DROP PROCEDURE test_sp;
+DROP TABLE t1;
+
+###########################################################################
#
# Bug#38291 memory corruption and server crash with view/sp/function
#
@@ -8023,6 +8039,46 @@ drop function f1;
drop view v1;
drop table t1;
+#
+# Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar
+#
+delimiter $;
+--disable_warnings
+drop procedure if exists `p2` $
+--enable_warnings
+create procedure `p2`(in `a` text charset utf8)
+begin
+ declare `pos` int default 1;
+ declare `str` text charset utf8;
+ set `str` := `a`;
+ select substr(`str`, `pos`+ 1 ) into `str`;
+end $
+delimiter ;$
+call `p2`('s s s s s s');
+drop procedure `p2`;
+
+#
+# Bug#38823: Invalid memory access when a SP statement does wildcard expansion
+#
+
+--disable_warnings
+drop table if exists t1;
+drop procedure if exists p1;
+--enable_warnings
+
+delimiter $;
+create procedure p1() begin select * from t1; end$
+--error ER_NO_SUCH_TABLE
+call p1$
+create table t1 (a integer)$
+call p1$
+alter table t1 add b integer;
+call p1$
+delimiter ;$
+
+drop table t1;
+drop procedure p1;
+
--echo # ------------------------------------------------------------------
--echo # -- End of 5.0 tests
--echo # ------------------------------------------------------------------
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 8bd9ee26b26..bc241423417 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -4,6 +4,11 @@
# embedded server causes different stat
-- source include/not_embedded.inc
+# Disable concurrent inserts to avoid sporadic test failures as it might
+# affect the the value of variables used throughout the test case.
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 0;
+
# PS causes different statistics
--disable_ps_protocol
@@ -12,54 +17,45 @@ connect (con2,localhost,root,,);
flush status;
-# Logging to the general query log table (--log-output=table --log) increments
-# Table_locks_immediate with each query, so here Immediate becomes 1
show status like 'Table_lock%';
-# ++Immediate = 2
select * from information_schema.session_status where variable_name like 'Table_lock%';
connection con1;
-# ++Immediate = 3
-SET SQL_LOG_BIN=0;
-set @old_general_log = @@global.general_log;
+--echo # Switched to connection: con1
+set sql_log_bin=0;
+set @old_general_log = @@global.general_log;
set global general_log = 'OFF';
--disable_warnings
-# ++Immediate = 4
drop table if exists t1;
--enable_warnings
-# ++Immediate = 5
create table t1(n int) engine=myisam;
-# Immediate + 2 = 7
insert into t1 values(1);
+# Execute dummy select in order to ensure that tables used in the
+# previous statement are unlocked and closed.
+select 1;
connection con2;
-# Immediate + 2 = 9
+--echo # Switched to connection: con2
lock tables t1 read;
-# ++Immediate = 10
unlock tables;
-# Immediate + 2 = 12
lock tables t1 read;
connection con1;
-# ++Immediate = 13
+--echo # Switched to connection: con1
let $ID= `select connection_id()`;
-# ++Immediate = 14 (Not +2, because this increments Table_locks_waited)
---send
-update t1 set n = 3;
+--send update t1 set n = 3
connection con2;
+--echo # Switched to connection: con2
# wait for the other query to start executing
let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = "Locked";
-# Immediate = 14 + $wait_condition_reps ($wait_timeout is 0, so no extra select
-# is done inside wait_condition.inc)
--source include/wait_condition.inc
-# ++Immediate = 15 + $wait_condition_reps
unlock tables;
connection con1;
+--echo # Switched to connection: con1
reap;
-# ++Immediate = 16 + $wait_condition_reps
show status like 'Table_locks_waited';
drop table t1;
set global general_log = @old_general_log;
@@ -67,6 +63,7 @@ set global general_log = @old_general_log;
disconnect con2;
disconnect con1;
connection default;
+--echo # Switched to connection: default
# End of 4.1 tests
@@ -295,3 +292,7 @@ drop database db37908;
drop procedure proc37908;
drop function func37908;
# End of 5.1 tests
+
+# Restore global concurrent_insert value. Keep in the end of the test file.
+--connection default
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index ec13f8af705..7c3d5013b8d 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -618,6 +618,28 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
DROP TABLE t1, t2;
+#
+# Bug #37894: Assertion in init_read_record_seq in handler.h line 1444
+#
+
+CREATE TABLE t1 (
+ pk INT PRIMARY KEY,
+ int_key INT,
+ varchar_key VARCHAR(5) UNIQUE,
+ varchar_nokey VARCHAR(5)
+);
+INSERT INTO t1 VALUES (9, 7,NULL,NULL), (10,8,'p' ,'p');
+
+SELECT varchar_nokey
+FROM t1
+WHERE NULL NOT IN (
+ SELECT INNR.pk FROM t1 AS INNR2
+ LEFT JOIN t1 AS INNR ON ( INNR2.int_key = INNR.int_key )
+ WHERE INNR.varchar_key > 'n{'
+);
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 1371a470ffd..3c7e9b658f3 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -74,12 +74,12 @@ create database mysqltest;
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="/this-dir-does-not-exist";
# temporarily disabled as it returns different result in the embedded server
-# --error 1210, 1210
+# --error ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS
# create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
# Should fail becasue the file t9.MYI already exist in 'run'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1,1,1105
+--error 1,1,ER_UNKNOWN_ERROR
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run";
# Should fail becasue the file t9.MYD already exist in 'tmp'
@@ -195,19 +195,19 @@ DROP TABLE t1;
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
--replace_result $MYSQLTEST_VARDIR TEST_DIR
diff --git a/mysql-test/t/thread_cache_size_func.test b/mysql-test/t/thread_cache_size_func.test
index 302f66a36c6..fe9f4242c0d 100644
--- a/mysql-test/t/thread_cache_size_func.test
+++ b/mysql-test/t/thread_cache_size_func.test
@@ -1,26 +1,27 @@
-############# mysql-test\t\thread_cache_size_func.test #######################################
-# #
-# Variable Name: thread_cache_size #
-# Scope: SESSION #
-# Access Type: Dynamic #
-# Data Type: Enumeration #
-# Default Value: 0 #
-# Values: 0-16384 #
-# #
-# #
-# Creation Date: 2008-03-02 #
-# Author: Sharique Abdullah #
-# #
-# Description: Test Cases of Dynamic System Variable "thread_cache_size" #
-# that checks behavior of this variable in the following ways #
-# * Functionality based on different values #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
-# option_mysqld_thread_cache_size #
-# #
-#########################################################################################
-
-
+############# mysql-test\t\thread_cache_size_func.test ##########################
+# #
+# Variable Name: thread_cache_size #
+# Scope: SESSION #
+# Access Type: Dynamic #
+# Data Type: Enumeration #
+# Default Value: 0 #
+# Values: 0-16384 #
+# #
+# #
+# Creation Date: 2008-03-02 #
+# Author: Sharique Abdullah #
+# #
+# Modified: HHunger 2008-08-27 Reduced test to needed function and inserted #
+# wait-loops #
+# #
+# Description: Test Cases of Dynamic System Variable "thread_cache_size" #
+# that checks behavior of this variable in the following ways #
+# * Functionality based on different values #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+#################################################################################
#
# Setup
@@ -32,41 +33,31 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
FLUSH STATUS;
-#
-# Greater than cache threads, setting cache size to 3
-#
-- ECHO '# Test1#'
SET @@GLOBAL.thread_cache_size=3;
-
-let $threadsCreated1 = query_get_value(SHOW STATUS LIKE 'Threads_created', Value, 1);
---echo Saving threads cached, threads created values
-
SHOW STATUS LIKE 'Threads_cached';
--echo 0 Expected
---ECHO '#Old value for thread_cache'#
-
##################################
# Make 4 connections #
##################################
--echo ** Connecting conn1 using username 'root' **
-connect (conn1,localhost,root,,);
+CONNECT (conn1,localhost,root,,);
--echo ** Connecting conn2 using username 'root' **
-connect (conn2,localhost,root,,);
+CONNECT (conn2,localhost,root,,);
--echo ** Connecting conn3 using username 'root' **
-connect (conn3,localhost,root,,);
+CONNECT (conn3,localhost,root,,);
--echo ** Connecting conn4 using username 'root' **
-connect (conn4,localhost,root,,);
+CONNECT (conn4,localhost,root,,);
-let $threadsCreated2 = query_get_value(SHOW STATUS LIKE 'Threads_created', Value, 1);
---echo Saving threads cached, threads created values
+--echo ** Connection default **
+CONNECTION default;
---disable_query_log
-eval SELECT ($threadsCreated2 - $threadsCreated1) AS 'Threads Created Difference';
---enable_query_log
+# Wait until all connections done
+let $wait_condition= SELECT COUNT(*)= 5 FROM INFORMATION_SCHEMA.PROCESSLIST;
+--source include/wait_condition.inc
---echo 4 Expected
SHOW STATUS LIKE 'Threads_cached';
--echo 0 Expected
@@ -74,85 +65,54 @@ SHOW STATUS LIKE 'Threads_cached';
#Disconnecting all the connections #
####################################
---echo ** Connection default **
-connection default;
-
--echo ** Disconnecting conn1,conn2,conn3,conn4 **
-disconnect conn1;
-disconnect conn2;
-disconnect conn3;
-disconnect conn4;
+DISCONNECT conn1;
+DISCONNECT conn2;
+DISCONNECT conn3;
+DISCONNECT conn4;
#
# Checking the status
#
---echo '#new values for thread cache after disconnecting'#
-let $threadsCreated3 = query_get_value(SHOW STATUS LIKE 'Threads_created', Value, 1);
+# Wait until all disconnects ready
+let $wait_condition= SELECT COUNT(*)= 1 FROM INFORMATION_SCHEMA.PROCESSLIST;
+--source include/wait_condition.inc
---echo Saving threads cached, threads created values
---disable_query_log
-eval SELECT ($threadsCreated3 - $threadsCreated2) AS 'Threads Created Difference';
---enable_query_log
---echo 0 Expected
SHOW STATUS LIKE 'Threads_cached';
--echo 3 Expected
-
#
# Decreasing cache size to 1
#
-SET @@GLOBAL.thread_cache_size=1;
-
-connection default;
-
-let $threadsCreated6 = query_get_value(SHOW STATUS LIKE 'Threads_created', Value, 1);
---echo Saving threads cached, threads created values
---disable_query_log
-eval SELECT $threadsCreated6 - $threadsCreated3 AS 'Threads Created Difference';
---enable_query_log
---echo 0 Expected
-SHOW STATUS LIKE 'Threads_cached';
---echo 1 Expected
---echo Bug: The number of threads cached should have decreased with cache size decrease.
+SET @@GLOBAL.thread_cache_size= 1;
--echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
--echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
-let $threadsCreated4 = query_get_value(SHOW STATUS LIKE 'Threads_created', Value, 1);
---echo Saving threads cached, threads created values
---disable_query_log
-eval SELECT $threadsCreated4 - $threadsCreated3 AS 'Threads Created Difference';
---enable_query_log
---echo 1 Expected
---echo Bug: The number of threads created should have increased because the cache should have 1 thread only
-SHOW STATUS LIKE 'Threads_cached';
---echo 0 Expected
---echo Bug: The number of threads created should have decreased because atleast 1 new connection came in
+--echo connection default;
+CONNECTION default;
---echo ** Connection default **
-connection default;
+# Wait until all connects ready
+let $wait_condition= SELECT COUNT(*)= 3 FROM INFORMATION_SCHEMA.PROCESSLIST;
+--source include/wait_condition.inc
--echo ** Disconnecting conn1,conn2 **
-disconnect conn1;
-disconnect conn2;
-
---ECHO '#new status values for thread cache'#
-let $threadsCreated5 = query_get_value(SHOW STATUS LIKE 'Threads_created', Value, 1);
---echo Saving threads cached, threads created values
---disable_query_log
-eval SELECT ($threadsCreated5 - $threadsCreated4) AS 'Threads Created Difference';
---enable_query_log
---echo 0 Expected
+DISCONNECT conn1;
+DISCONNECT conn2;
+
+# Wait until all disconnects ready
+let $wait_condition= SELECT COUNT(*)= 1 FROM INFORMATION_SCHEMA.PROCESSLIST;
+--source include/wait_condition.inc
+
SHOW STATUS LIKE 'Threads_cached';
--echo 1 Expected
---echo Saving threads cached, threads created values
-
#
# Cleanup
#
SET @@GLOBAL.thread_cache_size = @global_thread_cache_size;
+
diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test
index 5db5b982773..4d6e82dedcb 100644
--- a/mysql-test/t/trigger-trans.test
+++ b/mysql-test/t/trigger-trans.test
@@ -162,3 +162,18 @@ DROP TABLE t2, t1;
--echo End of 5.0 tests
+
+--echo BUG#31612
+--echo Trigger fired multiple times leads to gaps in auto_increment sequence
+create table t1 (a int, val char(1)) engine=InnoDB;
+create table t2 (b int auto_increment primary key,
+ val char(1)) engine=InnoDB;
+create trigger t1_after_insert after
+ insert on t1 for each row insert into t2 set val=NEW.val;
+insert into t1 values ( 123, 'a'), ( 123, 'b'), ( 123, 'c'),
+ (123, 'd'), (123, 'e'), (123, 'f'), (123, 'g');
+insert into t1 values ( 654, 'a'), ( 654, 'b'), ( 654, 'c'),
+ (654, 'd'), (654, 'e'), (654, 'f'), (654, 'g');
+select * from t2 order by b;
+drop trigger t1_after_insert;
+drop table t1,t2;
diff --git a/mysql-test/t/tx_isolation_func.test b/mysql-test/t/tx_isolation_func.test
index 3a4167dc368..1fd2e323db8 100644
--- a/mysql-test/t/tx_isolation_func.test
+++ b/mysql-test/t/tx_isolation_func.test
@@ -75,10 +75,12 @@ INSERT INTO t1 VALUES(24, 24);
--echo ** Connection con0 **
connection con0;
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+set binlog_format=mixed;
--echo ** Connection con1 **
connection con1;
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+set binlog_format=mixed;
#
# Testing WHERE on keys using IN clause
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index f2699ab03d3..5d916e410e3 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -263,4 +263,26 @@ from t1 order by score desc;
--enable_result_log
drop table t1;
+#
+# Bug#26020: User-Defined Variables are not consistent with columns data types
+#
+
+create table t1(b bigint);
+insert into t1 (b) values (10), (30), (10);
+set @var := 0;
+select if(b=@var, 999, b) , @var := b from t1 order by b;
+drop table t1;
+
+create temporary table t1 (id int);
+insert into t1 values (2), (3), (3), (4);
+set @lastid=-1;
+select @lastid != id, @lastid, @lastid := id from t1;
+drop table t1;
+
+create temporary table t1 (id bigint);
+insert into t1 values (2), (3), (3), (4);
+set @lastid=-1;
+select @lastid != id, @lastid, @lastid := id from t1;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 7db1a693a93..05aa76d492d 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3556,6 +3556,15 @@ DROP VIEW v1;
###########################################################################
+#
+# Bug#39040: valgrind errors/crash when creating views with binlog logging
+# enabled
+#
+# Bug is visible only when running in valgrind with binary logging.
+CREATE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.0 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
index 92ca0c3a3ec..6871caaa756 100644..100755
--- a/mysql-test/t/windows.test
+++ b/mysql-test/t/windows.test
@@ -33,6 +33,7 @@ drop table t1;
#
CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,1);
EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
+DROP TABLE t1;
--echo End of 5.0 tests.
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test
index 0d564727fe3..591d7ac2c4d 100644
--- a/mysql-test/t/xa.test
+++ b/mysql-test/t/xa.test
@@ -74,3 +74,48 @@ xa start 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
select * from t1;
drop table t1;
+disconnect con1;
+
+#
+# Bug#28323: Server crashed in xid cache operations
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1(a int, b int, c varchar(20), primary key(a)) engine = innodb;
+insert into t1 values(1, 1, 'a');
+insert into t1 values(2, 2, 'b');
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+--connection con1
+xa start 'a','b';
+update t1 set c = 'aa' where a = 1;
+--connection con2
+xa start 'a','c';
+update t1 set c = 'bb' where a = 2;
+--connection con1
+--send update t1 set c = 'bb' where a = 2
+--connection con2
+--sleep 1
+--error ER_LOCK_DEADLOCK
+update t1 set c = 'aa' where a = 1;
+select count(*) from t1;
+--error ER_XA_RBDEADLOCK
+xa end 'a','c';
+xa rollback 'a','c';
+--disconnect con2
+
+connect (con3,localhost,root,,);
+--connection con3
+xa start 'a','c';
+
+--disconnect con1
+--disconnect con3
+--connection default
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index e25699ac9fe..8d578cd22cb 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -513,6 +513,15 @@
fun:_dl_open
}
+{
+ libc pthread_exit 8
+ Memcheck:Leak
+ fun:malloc
+ fun:local_strdup
+ fun:_dl_map_object
+ fun:dl_open_worker
+}
+
#
# This is seen internally in the system libraries on 64-bit RHAS3.
#
diff --git a/mysys/hash.c b/mysys/hash.c
index 3a9f05a3e0b..78204a8cc48 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -33,7 +33,7 @@ typedef struct st_hash_info {
uchar *data; /* data for current entry */
} HASH_LINK;
-static uint hash_mask(uint hashnr,uint buffmax,uint maxlength);
+static uint my_hash_mask(uint hashnr, uint buffmax, uint maxlength);
static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
size_t length);
@@ -46,19 +46,19 @@ static uint calc_hash(const HASH *hash, const uchar *key, size_t length)
}
my_bool
-_hash_init(HASH *hash,uint growth_size, CHARSET_INFO *charset,
- ulong size, size_t key_offset, size_t key_length,
- hash_get_key get_key,
- void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
+_my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset,
+ ulong size, size_t key_offset, size_t key_length,
+ my_hash_get_key get_key,
+ void (*free_element)(void*), uint flags CALLER_INFO_PROTO)
{
- DBUG_ENTER("hash_init");
+ DBUG_ENTER("my_hash_init");
DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size));
hash->records=0;
if (my_init_dynamic_array_ci(&hash->array, sizeof(HASH_LINK), size,
growth_size))
{
- hash->free=0; /* Allow call to hash_free */
+ hash->free=0; /* Allow call to my_hash_free */
DBUG_RETURN(1);
}
hash->key_offset=key_offset;
@@ -76,14 +76,14 @@ _hash_init(HASH *hash,uint growth_size, CHARSET_INFO *charset,
Call hash->free on all elements in hash.
SYNOPSIS
- hash_free_elements()
+ my_hash_free_elements()
hash hash table
NOTES:
Sets records to 0
*/
-static inline void hash_free_elements(HASH *hash)
+static inline void my_hash_free_elements(HASH *hash)
{
if (hash->free)
{
@@ -100,18 +100,18 @@ static inline void hash_free_elements(HASH *hash)
Free memory used by hash.
SYNOPSIS
- hash_free()
+ my_hash_free()
hash the hash to delete elements of
- NOTES: Hash can't be reused without calling hash_init again.
+ NOTES: Hash can't be reused without calling my_hash_init again.
*/
-void hash_free(HASH *hash)
+void my_hash_free(HASH *hash)
{
- DBUG_ENTER("hash_free");
+ DBUG_ENTER("my_hash_free");
DBUG_PRINT("enter",("hash: 0x%lx", (long) hash));
- hash_free_elements(hash);
+ my_hash_free_elements(hash);
hash->free= 0;
delete_dynamic(&hash->array);
DBUG_VOID_RETURN;
@@ -131,7 +131,7 @@ void my_hash_reset(HASH *hash)
DBUG_ENTER("my_hash_reset");
DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash));
- hash_free_elements(hash);
+ my_hash_free_elements(hash);
reset_dynamic(&hash->array);
/* Set row pointers so that the hash can be reused at once */
hash->blength= 1;
@@ -146,8 +146,8 @@ void my_hash_reset(HASH *hash)
*/
static inline char*
-hash_key(const HASH *hash, const uchar *record, size_t *length,
- my_bool first)
+my_hash_key(const HASH *hash, const uchar *record, size_t *length,
+ my_bool first)
{
if (hash->get_key)
return (char*) (*hash->get_key)(record,length,first);
@@ -157,18 +157,18 @@ hash_key(const HASH *hash, const uchar *record, size_t *length,
/* Calculate pos according to keys */
-static uint hash_mask(uint hashnr,uint buffmax,uint maxlength)
+static uint my_hash_mask(uint hashnr, uint buffmax, uint maxlength)
{
if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1));
return (hashnr & ((buffmax >> 1) -1));
}
-static uint hash_rec_mask(const HASH *hash, HASH_LINK *pos,
- uint buffmax, uint maxlength)
+static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos,
+ uint buffmax, uint maxlength)
{
size_t length;
- uchar *key= (uchar*) hash_key(hash,pos->data,&length,0);
- return hash_mask(calc_hash(hash,key,length),buffmax,maxlength);
+ uchar *key= (uchar*) my_hash_key(hash, pos->data, &length, 0);
+ return my_hash_mask(calc_hash(hash, key, length), buffmax, maxlength);
}
@@ -181,15 +181,15 @@ inline
unsigned int rec_hashnr(HASH *hash,const uchar *record)
{
size_t length;
- uchar *key= (uchar*) hash_key(hash,record,&length,0);
+ uchar *key= (uchar*) my_hash_key(hash, record, &length, 0);
return calc_hash(hash,key,length);
}
-uchar* hash_search(const HASH *hash, const uchar *key, size_t length)
+uchar* my_hash_search(const HASH *hash, const uchar *key, size_t length)
{
HASH_SEARCH_STATE state;
- return hash_first(hash, key, length, &state);
+ return my_hash_first(hash, key, length, &state);
}
/*
@@ -199,18 +199,18 @@ uchar* hash_search(const HASH *hash, const uchar *key, size_t length)
Assigns the number of the found record to HASH_SEARCH_STATE state
*/
-uchar* hash_first(const HASH *hash, const uchar *key, size_t length,
- HASH_SEARCH_STATE *current_record)
+uchar* my_hash_first(const HASH *hash, const uchar *key, size_t length,
+ HASH_SEARCH_STATE *current_record)
{
HASH_LINK *pos;
uint flag,idx;
- DBUG_ENTER("hash_first");
+ DBUG_ENTER("my_hash_first");
flag=1;
if (hash->records)
{
- idx=hash_mask(calc_hash(hash,key,length ? length : hash->key_length),
- hash->blength,hash->records);
+ idx= my_hash_mask(calc_hash(hash, key, length ? length : hash->key_length),
+ hash->blength, hash->records);
do
{
pos= dynamic_element(&hash->array,idx,HASH_LINK*);
@@ -223,7 +223,7 @@ uchar* hash_first(const HASH *hash, const uchar *key, size_t length,
if (flag)
{
flag=0; /* Reset flag */
- if (hash_rec_mask(hash,pos,hash->blength,hash->records) != idx)
+ if (my_hash_rec_mask(hash, pos, hash->blength, hash->records) != idx)
break; /* Wrong link */
}
}
@@ -234,10 +234,10 @@ uchar* hash_first(const HASH *hash, const uchar *key, size_t length,
}
/* Get next record with identical key */
- /* Can only be called if previous calls was hash_search */
+ /* Can only be called if previous calls was my_hash_search */
-uchar* hash_next(const HASH *hash, const uchar *key, size_t length,
- HASH_SEARCH_STATE *current_record)
+uchar* my_hash_next(const HASH *hash, const uchar *key, size_t length,
+ HASH_SEARCH_STATE *current_record)
{
HASH_LINK *pos;
uint idx;
@@ -297,7 +297,7 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
size_t length)
{
size_t rec_keylength;
- uchar *rec_key= (uchar*) hash_key(hash,pos->data,&rec_keylength,1);
+ uchar *rec_key= (uchar*) my_hash_key(hash, pos->data, &rec_keylength, 1);
return ((length && length != rec_keylength) ||
my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
(uchar*) key, rec_keylength));
@@ -306,7 +306,7 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
/* Write a hash-key to the hash-index */
-my_bool my_hash_insert(HASH *info,const uchar *record)
+my_bool my_hash_insert(HASH *info, const uchar *record)
{
int flag;
size_t idx;
@@ -321,8 +321,8 @@ my_bool my_hash_insert(HASH *info,const uchar *record)
if (info->flags & HASH_UNIQUE)
{
- uchar *key= (uchar*) hash_key(info, record, &idx, 1);
- if (hash_search(info, key, idx))
+ uchar *key= (uchar*) my_hash_key(info, record, &idx, 1);
+ if (my_hash_search(info, key, idx))
return(TRUE); /* Duplicate entry */
}
@@ -341,7 +341,7 @@ my_bool my_hash_insert(HASH *info,const uchar *record)
pos=data+idx;
hash_nr=rec_hashnr(info,pos->data);
if (flag == 0) /* First loop; Check if ok */
- if (hash_mask(hash_nr,info->blength,info->records) != first_index)
+ if (my_hash_mask(hash_nr, info->blength, info->records) != first_index)
break;
if (!(hash_nr & halfbuff))
{ /* Key will not move */
@@ -413,7 +413,7 @@ my_bool my_hash_insert(HASH *info,const uchar *record)
}
/* Check if we are at the empty position */
- idx=hash_mask(rec_hashnr(info,record),info->blength,info->records+1);
+ idx= my_hash_mask(rec_hashnr(info, record), info->blength, info->records + 1);
pos=data+idx;
if (pos == empty)
{
@@ -424,7 +424,7 @@ my_bool my_hash_insert(HASH *info,const uchar *record)
{
/* Check if more records in same hash-nr family */
empty[0]=pos[0];
- gpos=data+hash_rec_mask(info,pos,info->blength,info->records+1);
+ gpos= data + my_hash_rec_mask(info, pos, info->blength, info->records + 1);
if (pos == gpos)
{
pos->data=(uchar*) record;
@@ -449,18 +449,18 @@ my_bool my_hash_insert(HASH *info,const uchar *record)
** if there is a free-function it's called for record if found
******************************************************************************/
-my_bool hash_delete(HASH *hash,uchar *record)
+my_bool my_hash_delete(HASH *hash, uchar *record)
{
uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index;
HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty;
- DBUG_ENTER("hash_delete");
+ DBUG_ENTER("my_hash_delete");
if (!hash->records)
DBUG_RETURN(1);
blength=hash->blength;
data=dynamic_element(&hash->array,0,HASH_LINK*);
/* Search after record with key */
- pos=data+ hash_mask(rec_hashnr(hash,record),blength,hash->records);
+ pos= data + my_hash_mask(rec_hashnr(hash, record), blength, hash->records);
gpos = 0;
while (pos->data != record)
@@ -491,7 +491,7 @@ my_bool hash_delete(HASH *hash,uchar *record)
/* Move the last key (lastpos) */
lastpos_hashnr=rec_hashnr(hash,lastpos->data);
/* pos is where lastpos should be */
- pos=data+hash_mask(lastpos_hashnr,hash->blength,hash->records);
+ pos= data + my_hash_mask(lastpos_hashnr, hash->blength, hash->records);
if (pos == empty) /* Move to empty position. */
{
empty[0]=lastpos[0];
@@ -499,7 +499,7 @@ my_bool hash_delete(HASH *hash,uchar *record)
}
pos_hashnr=rec_hashnr(hash,pos->data);
/* pos3 is where the pos should be */
- pos3= data+hash_mask(pos_hashnr,hash->blength,hash->records);
+ pos3= data + my_hash_mask(pos_hashnr, hash->blength, hash->records);
if (pos != pos3)
{ /* pos is on wrong posit */
empty[0]=pos[0]; /* Save it here */
@@ -507,8 +507,8 @@ my_bool hash_delete(HASH *hash,uchar *record)
movelink(data,(uint) (pos-data),(uint) (pos3-data),empty_index);
goto exit;
}
- pos2= hash_mask(lastpos_hashnr,blength,hash->records+1);
- if (pos2 == hash_mask(pos_hashnr,blength,hash->records+1))
+ pos2= my_hash_mask(lastpos_hashnr, blength, hash->records + 1);
+ if (pos2 == my_hash_mask(pos_hashnr, blength, hash->records + 1))
{ /* Identical key-positions */
if (pos2 != hash->records)
{
@@ -536,26 +536,26 @@ exit:
This is much more efficent than using a delete & insert.
*/
-my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
- size_t old_key_length)
+my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key,
+ size_t old_key_length)
{
uint new_index,new_pos_index,blength,records,empty;
size_t idx;
HASH_LINK org_link,*data,*previous,*pos;
- DBUG_ENTER("hash_update");
+ DBUG_ENTER("my_hash_update");
if (HASH_UNIQUE & hash->flags)
{
HASH_SEARCH_STATE state;
- uchar *found, *new_key= (uchar*) hash_key(hash, record, &idx, 1);
- if ((found= hash_first(hash, new_key, idx, &state)))
+ uchar *found, *new_key= (uchar*) my_hash_key(hash, record, &idx, 1);
+ if ((found= my_hash_first(hash, new_key, idx, &state)))
{
do
{
if (found != record)
DBUG_RETURN(1); /* Duplicate entry */
}
- while ((found= hash_next(hash, new_key, idx, &state)));
+ while ((found= my_hash_next(hash, new_key, idx, &state)));
}
}
@@ -564,11 +564,11 @@ my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
/* Search after record with key */
- idx=hash_mask(calc_hash(hash, old_key,(old_key_length ?
- old_key_length :
- hash->key_length)),
- blength,records);
- new_index=hash_mask(rec_hashnr(hash,record),blength,records);
+ idx= my_hash_mask(calc_hash(hash, old_key, (old_key_length ?
+ old_key_length :
+ hash->key_length)),
+ blength, records);
+ new_index= my_hash_mask(rec_hashnr(hash, record), blength, records);
if (idx == new_index)
DBUG_RETURN(0); /* Nothing to do (No record check) */
previous=0;
@@ -618,7 +618,7 @@ my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
DBUG_RETURN(0);
}
pos=data+new_index;
- new_pos_index=hash_rec_mask(hash,pos,blength,records);
+ new_pos_index= my_hash_rec_mask(hash, pos, blength, records);
if (new_index != new_pos_index)
{ /* Other record in wrong position */
data[empty] = *pos;
@@ -636,7 +636,7 @@ my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
}
-uchar *hash_element(HASH *hash,ulong idx)
+uchar *my_hash_element(HASH *hash, ulong idx)
{
if (idx < hash->records)
return dynamic_element(&hash->array,idx,HASH_LINK*)->data;
@@ -649,7 +649,8 @@ uchar *hash_element(HASH *hash,ulong idx)
isn't changed
*/
-void hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record, uchar *new_row)
+void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record,
+ uchar *new_row)
{
if (*current_record != NO_RECORD) /* Safety */
dynamic_element(&hash->array, *current_record, HASH_LINK*)->data= new_row;
@@ -658,7 +659,7 @@ void hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record, uchar *new_row)
#ifndef DBUG_OFF
-my_bool hash_check(HASH *hash)
+my_bool my_hash_check(HASH *hash)
{
int error;
uint i,rec_link,found,max_links,seek,links,idx;
@@ -671,7 +672,7 @@ my_bool hash_check(HASH *hash)
for (i=found=max_links=seek=0 ; i < records ; i++)
{
- if (hash_rec_mask(hash,data+i,blength,records) == i)
+ if (my_hash_rec_mask(hash, data + i, blength, records) == i)
{
found++; seek++; links=1;
for (idx=data[i].next ;
@@ -687,11 +688,12 @@ my_bool hash_check(HASH *hash)
}
hash_info=data+idx;
seek+= ++links;
- if ((rec_link=hash_rec_mask(hash,hash_info,blength,records)) != i)
+ if ((rec_link= my_hash_rec_mask(hash, hash_info,
+ blength, records)) != i)
{
- DBUG_PRINT("error",
- ("Record in wrong link at %d: Start %d Record: 0x%lx Record-link %d",
- idx, i, (long) hash_info->data, rec_link));
+ DBUG_PRINT("error", ("Record in wrong link at %d: Start %d "
+ "Record: 0x%lx Record-link %d",
+ idx, i, (long) hash_info->data, rec_link));
error=1;
}
else
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index f8c6ebf02c3..258e227bb7b 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -90,16 +90,6 @@ int my_symlink(const char *content, const char *linkname, myf MyFlags)
#endif /* HAVE_READLINK */
}
-/*
- Resolve all symbolic links in path
- 'to' may be equal to 'filename'
-
- Because purify gives a lot of UMR errors when using realpath(),
- this code is disabled when using purify.
-
- If MY_RESOLVE_LINK is given, only do realpath if the file is a link.
-*/
-
#if defined(SCO)
#define BUFF_LEN 4097
#elif defined(MAXPATHLEN)
@@ -124,10 +114,15 @@ int my_is_symlink(const char *filename __attribute__((unused)))
}
+/*
+ Resolve all symbolic links in path
+ 'to' may be equal to 'filename'
+*/
+
int my_realpath(char *to, const char *filename,
myf MyFlags __attribute__((unused)))
{
-#if defined(HAVE_REALPATH) && !defined(HAVE_purify) && !defined(HAVE_BROKEN_REALPATH)
+#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
int result=0;
char buff[BUFF_LEN];
char *ptr;
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c
index 5b941bbd7d6..66a361b5421 100644
--- a/mysys/stacktrace.c
+++ b/mysys/stacktrace.c
@@ -317,6 +317,7 @@ void my_write_core(int sig)
#else /* __WIN__*/
#include <dbghelp.h>
+#include <tlhelp32.h>
/*
Stack tracing on Windows is implemented using Debug Helper library(dbghelp.dll)
@@ -409,6 +410,68 @@ void my_set_exception_pointers(EXCEPTION_POINTERS *ep)
exception_ptrs = ep;
}
+
+/*
+ Get symbol path - semicolon-separated list of directories to search for debug
+ symbols. We expect PDB in the same directory as corresponding exe or dll,
+ so the path is build from directories of the loaded modules. If environment
+ variable _NT_SYMBOL_PATH is set, it's value appended to the symbol search path
+*/
+static void get_symbol_path(char *path, size_t size)
+{
+ HANDLE hSnap;
+ char *envvar;
+
+ path[0]= '\0';
+ /*
+ Enumerate all modules, and add their directories to the path.
+ Avoid duplicate entries.
+ */
+ hSnap= CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
+ if (hSnap != INVALID_HANDLE_VALUE)
+ {
+ BOOL ret;
+ MODULEENTRY32 mod;
+ mod.dwSize= sizeof(MODULEENTRY32);
+ for (ret= Module32First(hSnap, &mod); ret; ret= Module32Next(hSnap, &mod))
+ {
+ char *module_dir= mod.szExePath;
+ char *p= strrchr(module_dir,'\\');
+ if (!p)
+ {
+ /*
+ Path separator was not found. Not known to happen, if ever happens,
+ will indicate current directory.
+ */
+ module_dir[0]= '.';
+ p= module_dir + 1;
+ }
+ *p++= ';';
+ *p= '\0';
+
+ if (!strstr(path, module_dir))
+ {
+ size_t dir_len = strlen(module_dir);
+ if (size > dir_len)
+ {
+ strncat(path, module_dir, size-1);
+ size -= dir_len;
+ }
+ }
+ }
+ CloseHandle(hSnap);
+ }
+
+ /* Add _NT_SYMBOL_PATH, if present. */
+ envvar= getenv("_NT_SYMBOL_PATH");
+ if(envvar && size)
+ {
+ strncat(path, envvar, size-1);
+ }
+}
+
+#define MAX_SYMBOL_PATH 32768
+
/* Platform SDK in VS2003 does not have definition for SYMOPT_NO_PROMPTS*/
#ifndef SYMOPT_NO_PROMPTS
#define SYMOPT_NO_PROMPTS 0
@@ -425,6 +488,7 @@ void my_print_stacktrace(uchar* unused1, ulong unused2)
int i;
CONTEXT context;
STACKFRAME64 frame={0};
+ static char symbol_path[MAX_SYMBOL_PATH];
if(!exception_ptrs || !init_dbghelp_functions())
return;
@@ -433,7 +497,8 @@ void my_print_stacktrace(uchar* unused1, ulong unused2)
context = *(exception_ptrs->ContextRecord);
/*Initialize symbols.*/
pSymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_NO_PROMPTS|SYMOPT_DEFERRED_LOADS|SYMOPT_DEBUG);
- pSymInitialize(hProcess,NULL,TRUE);
+ get_symbol_path(symbol_path, sizeof(symbol_path));
+ pSymInitialize(hProcess, symbol_path, TRUE);
/*Prepare stackframe for the first StackWalk64 call*/
frame.AddrFrame.Mode= frame.AddrPC.Mode= frame.AddrStack.Mode= AddrModeFlat;
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index aa46021a938..730fa9f9374 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -458,9 +458,33 @@ int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp,
mp->spins= MY_PTHREAD_FASTMUTEX_SPINS;
else
mp->spins= 0;
+ mp->rng_state= 1;
return pthread_mutex_init(&mp->mutex, attr);
}
+/**
+ Park-Miller random number generator. A simple linear congruential
+ generator that operates in multiplicative group of integers modulo n.
+
+ x_{k+1} = (x_k g) mod n
+
+ Popular pair of parameters: n = 2^32 − 5 = 4294967291 and g = 279470273.
+ The period of the generator is about 2^31.
+ Largest value that can be returned: 2147483646 (RAND_MAX)
+
+ Reference:
+
+ S. K. Park and K. W. Miller
+ "Random number generators: good ones are hard to find"
+ Commun. ACM, October 1988, Volume 31, No 10, pages 1192-1201.
+*/
+
+static double park_rng(my_pthread_fastmutex_t *mp)
+{
+ mp->rng_state= ((my_ulonglong)mp->rng_state * 279470273U) % 4294967291U;
+ return (mp->rng_state / 2147483647.0);
+}
+
int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp)
{
int res;
@@ -478,8 +502,7 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp)
return res;
mutex_delay(maxdelay);
- maxdelay += ((double) random() / (double) RAND_MAX) *
- MY_PTHREAD_FASTMUTEX_DELAY + 1;
+ maxdelay += park_rng(mp) * MY_PTHREAD_FASTMUTEX_DELAY + 1;
}
return pthread_mutex_lock(&mp->mutex);
}
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index ff9a4711832..339b2a4c219 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -385,6 +385,9 @@ copyfileto $BASE/include config.h include/*
rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
+# In a NetWare binary package, these tools and their manuals are not useful
+rm -f $BASE/man/man1/make_win_*
+
copyfileto $BASE/support-files support-files/*
copyfileto $BASE/share scripts/*.sql
@@ -427,6 +430,7 @@ fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
$BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \
+ $BASE/bin/make_win_* \
$BASE/bin/setsomevars $BASE/support-files/Makefile* \
$BASE/support-files/*.sh
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index 6db9430b972..9a3a3f7bb84 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -22,9 +22,9 @@ DROP TABLE tmp_db;
CREATE TEMPORARY TABLE tmp_user LIKE user;
set @current_hostname= @@hostname;
INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO tmp_user VALUES (@current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost';
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO tmp_user (host,user) VALUES ('localhost','');
-INSERT INTO tmp_user (host,user) VALUES (@current_hostname,'');
+INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
DROP TABLE tmp_user;
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index f05761bb837..60d972e1c8b 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -83,7 +83,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//;
my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('','');
- s/^# Query_time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//;
+ s/^# Query_time: ([0-9.]+)\s+Lock_time: ([0-9.]+)\s+Rows_sent: ([0-9.]+).*\n//;
my ($t, $l, $r) = ($1, $2, $3);
$t -= $l unless $opt{l};
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 5da1285f29a..83872803dd4 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -27,9 +27,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
- ${CMAKE_SOURCE_DIR}/sql/message.h
- ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
${CMAKE_SOURCE_DIR}/include/mysql_version.h
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
@@ -138,14 +136,6 @@ ADD_CUSTOM_COMMAND(
--output=sql_yacc.cc sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
-IF(WIN32)
- # Windows message file
- ADD_CUSTOM_COMMAND(
- OUTPUT ${PROJECT_SOURCE_DIR}/sql/message.h
-# ${PROJECT_SOURCE_DIR}/sql/message.rc
- COMMAND mc ARGS message.mc
- DEPENDS ${PROJECT_SOURCE_DIR}/sql/message.mc)
-ENDIF(WIN32)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
@@ -168,7 +158,7 @@ ADD_DEPENDENCIES(mysqld GenServerSource)
# Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
- "lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
+ "lex_hash.h;sql_yacc.h;sql_yacc.cc")
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings GenError)
diff --git a/sql/MSG00001.bin b/sql/MSG00001.bin
new file mode 100644
index 00000000000..89f547694f5
--- /dev/null
+++ b/sql/MSG00001.bin
Binary files differ
diff --git a/sql/Makefile.am b/sql/Makefile.am
index b9de9b279a3..e477a6123ec 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -146,8 +146,10 @@ DEFS = -DMYSQL_SERVER \
BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h
BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h link_sources
EXTRA_DIST = udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
- nt_servc.cc nt_servc.h message.mc CMakeLists.txt \
- udf_example.c udf_example.def
+ nt_servc.cc nt_servc.h \
+ message.mc message.h message.rc MSG00001.bin \
+ CMakeLists.txt
+
CLEANFILES = lex_hash.h sql_yacc.output link_sources
DISTCLEANFILES = $(EXTRA_PROGRAMS)
MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC)
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 382fd024aa8..c26b740d24a 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -185,6 +185,8 @@ mysql_event_fill_row(THD *thd,
DBUG_PRINT("info", ("dbname=[%s]", et->dbname.str));
DBUG_PRINT("info", ("name =[%s]", et->name.str));
+ DBUG_ASSERT(et->on_completion != Event_parse_data::ON_COMPLETION_DEFAULT);
+
if (table->s->fields < ET_FIELD_COUNT)
{
/*
@@ -745,6 +747,18 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
store_record(table,record[1]);
+ /*
+ We check whether ALTER EVENT was given dates that are in the past.
+ However to know how to react, we need the ON COMPLETION type. The
+ check is deferred to this point because by now we have the previous
+ setting (from the event-table) to fall back on if nothing was specified
+ in the ALTER EVENT-statement.
+ */
+
+ if (parse_data->check_dates(thd,
+ (int) table->field[ET_FIELD_ON_COMPLETION]->val_int()))
+ goto end;
+
/* Don't update create on row update. */
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc
index e87e4593f8f..df419e92d0d 100644
--- a/sql/event_parse_data.cc
+++ b/sql/event_parse_data.cc
@@ -45,7 +45,7 @@ Event_parse_data::new_instance(THD *thd)
*/
Event_parse_data::Event_parse_data()
- :on_completion(Event_parse_data::ON_COMPLETION_DROP),
+ :on_completion(Event_parse_data::ON_COMPLETION_DEFAULT),
status(Event_parse_data::ENABLED),
do_not_create(FALSE),
body_changed(FALSE),
@@ -114,6 +114,12 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc)
if (ltime_utc >= (my_time_t) thd->query_start())
return;
+ /*
+ We'll come back later when we have the real on_completion value
+ */
+ if (on_completion == Event_parse_data::ON_COMPLETION_DEFAULT)
+ return;
+
if (on_completion == Event_parse_data::ON_COMPLETION_DROP)
{
switch (thd->lex->sql_command) {
@@ -142,6 +148,42 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc)
/*
+ Check time/dates in ALTER EVENT
+
+ We check whether ALTER EVENT was given dates that are in the past.
+ However to know how to react, we need the ON COMPLETION type. Hence,
+ the check is deferred until we have the previous ON COMPLETION type
+ from the event-db to fall back on if nothing was specified in the
+ ALTER EVENT-statement.
+
+ SYNOPSIS
+ Event_parse_data::check_dates()
+ thd Thread
+ on_completion ON COMPLETION value currently in event-db.
+ Will be overridden by value in ALTER EVENT if given.
+
+ RETURN VALUE
+ TRUE an error occurred, do not ALTER
+ FALSE OK
+*/
+
+bool
+Event_parse_data::check_dates(THD *thd, int previous_on_completion)
+{
+ if (on_completion == Event_parse_data::ON_COMPLETION_DEFAULT)
+ {
+ on_completion= previous_on_completion;
+ if (!ends_null)
+ check_if_in_the_past(thd, ends);
+ if (!execute_at_null)
+ check_if_in_the_past(thd, execute_at);
+ }
+ return do_not_create;
+}
+
+
+
+/*
Sets time for execution for one-time event.
SYNOPSIS
diff --git a/sql/event_parse_data.h b/sql/event_parse_data.h
index 221bf92664f..87a800c2078 100644
--- a/sql/event_parse_data.h
+++ b/sql/event_parse_data.h
@@ -38,7 +38,12 @@ public:
enum enum_on_completion
{
- ON_COMPLETION_DROP = 1,
+ /*
+ On CREATE EVENT, DROP is the DEFAULT as per the docs.
+ On ALTER EVENT, "no change" is the DEFAULT.
+ */
+ ON_COMPLETION_DEFAULT = 0,
+ ON_COMPLETION_DROP,
ON_COMPLETION_PRESERVE
};
@@ -80,6 +85,9 @@ public:
bool
check_parse_data(THD *thd);
+ bool
+ check_dates(THD *thd, int previous_on_completion);
+
private:
void
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 5655a8acc99..d9d010783e8 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -301,12 +301,6 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
goto end;
}
- sql_print_information("Event Scheduler: "
- "[%s].[%s.%s] started in thread %lu.",
- job_data.definer.str,
- job_data.dbname.str, job_data.name.str,
- thd->thread_id);
-
thd->enable_slow_log= TRUE;
res= job_data.execute(thd, event->dropped);
@@ -318,13 +312,6 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
"[%s].[%s.%s] event execution failed.",
job_data.definer.str,
job_data.dbname.str, job_data.name.str);
- else
- sql_print_information("Event Scheduler: "
- "[%s].[%s.%s] executed successfully in thread %lu.",
- job_data.definer.str,
- job_data.dbname.str, job_data.name.str,
- thd->thread_id);
-
end:
DBUG_PRINT("info", ("Done with Event %s.%s", event->dbname.str,
event->name.str));
diff --git a/sql/field.cc b/sql/field.cc
index 6af2ea97b2d..95f3956521b 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -6608,7 +6608,8 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
uint length;
if (table->in_use->variables.sql_mode &
MODE_PAD_CHAR_TO_FULL_LENGTH)
- length= my_charpos(field_charset, ptr, ptr + field_length, field_length);
+ length= my_charpos(field_charset, ptr, ptr + field_length,
+ field_length / field_charset->mbmaxlen);
else
length= field_charset->cset->lengthsp(field_charset, (const char*) ptr,
field_length);
@@ -7696,8 +7697,18 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
return 0;
}
- if (from == value.ptr())
+ /*
+ If the 'from' address is in the range of the temporary 'value'-
+ object we need to copy the content to a different location or it will be
+ invalidated when the 'value'-object is reallocated to make room for
+ the new character set.
+ */
+ if (from >= value.ptr() && from <= value.ptr()+value.length())
{
+ /*
+ If content of the 'from'-address is cached in the 'value'-object
+ it is possible that the content needs a character conversion.
+ */
uint32 dummy_offset;
if (!String::needs_conversion(length, cs, field_charset, &dummy_offset))
{
@@ -8770,28 +8781,43 @@ bool Field::eq_def(Field *field)
return 1;
}
+
/**
@return
returns 1 if the fields are equally defined
*/
+
bool Field_enum::eq_def(Field *field)
{
if (!Field::eq_def(field))
return 0;
- TYPELIB *from_lib=((Field_enum*) field)->typelib;
+ return compare_enum_values(((Field_enum*) field)->typelib);
+}
- if (typelib->count < from_lib->count)
- return 0;
- for (uint i=0 ; i < from_lib->count ; i++)
+
+bool Field_enum::compare_enum_values(TYPELIB *values)
+{
+ if (typelib->count != values->count)
+ return FALSE;
+ for (uint i= 0; i < typelib->count; i++)
if (my_strnncoll(field_charset,
- (const uchar*)typelib->type_names[i],
- strlen(typelib->type_names[i]),
- (const uchar*)from_lib->type_names[i],
- strlen(from_lib->type_names[i])))
- return 0;
- return 1;
+ (const uchar*) typelib->type_names[i],
+ typelib->type_lengths[i],
+ (const uchar*) values->type_names[i],
+ values->type_lengths[i]))
+ return FALSE;
+ return TRUE;
+}
+
+
+uint Field_enum::is_equal(Create_field *new_field)
+{
+ if (!Field_str::is_equal(new_field))
+ return 0;
+ return compare_enum_values(new_field->interval);
}
+
/**
@return
returns 1 if the fields are equally defined
diff --git a/sql/field.h b/sql/field.h
index 6152cfccaba..851bce2f07a 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1597,8 +1597,16 @@ private:
class Field_blob :public Field_longstr {
protected:
+ /**
+ The number of bytes used to represent the length of the blob.
+ */
uint packlength;
- String value; // For temporaries
+
+ /**
+ The 'value'-object is a cache fronting the storage engine.
+ */
+ String value;
+
public:
Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
@@ -1845,6 +1853,8 @@ public:
CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
private:
int do_save_field_metadata(uchar *first_byte);
+ bool compare_enum_values(TYPELIB *values);
+ uint is_equal(Create_field *new_field);
};
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 4e1300c044c..ea5b340c970 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -9971,34 +9971,23 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info,
if (table_changes != IS_EQUAL_YES)
DBUG_RETURN(COMPATIBLE_DATA_NO);
- /**
- * Changing from/to primary key
- *
- * This is _not_ correct, but check_if_incompatible_data-interface
- * doesnt give more info, so I guess that we can't do any
- * online add index if not using primary key
- *
- * This as mysql will handle a unique not null index as primary
- * even wo/ user specifiying it... :-(
- *
- */
- if ((table_share->primary_key == MAX_KEY && pk) ||
- (table_share->primary_key != MAX_KEY && !pk) ||
- (table_share->primary_key == MAX_KEY && !pk && ai))
- {
- DBUG_RETURN(COMPATIBLE_DATA_NO);
- }
-
/* Check that auto_increment value was not changed */
if ((create_info->used_fields & HA_CREATE_USED_AUTO) &&
create_info->auto_increment_value != 0)
+ {
+ DBUG_PRINT("info", ("auto_increment value changed"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
+ }
/* Check that row format didn't change */
if ((create_info->used_fields & HA_CREATE_USED_AUTO) &&
get_row_type() != create_info->row_type)
+ {
+ DBUG_PRINT("info", ("row format changed"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
+ }
+ DBUG_PRINT("info", ("new table seems compatible"));
DBUG_RETURN(COMPATIBLE_DATA_YES);
}
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 078b22bff02..fe09ce3107e 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -107,7 +107,7 @@ static handler *partition_create_handler(handlerton *hton,
MEM_ROOT *mem_root)
{
ha_partition *file= new (mem_root) ha_partition(hton, share);
- if (file && file->initialise_partition(mem_root))
+ if (file && file->initialize_partition(mem_root))
{
delete file;
file= 0;
@@ -160,7 +160,7 @@ const uint ha_partition::NO_CURRENT_PART_ID= 0xFFFFFFFF;
ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
:handler(hton, share), m_part_info(NULL), m_create_handler(FALSE),
- m_is_sub_partitioned(0), is_clone(FALSE)
+ m_is_sub_partitioned(0)
{
DBUG_ENTER("ha_partition::ha_partition(table)");
init_handler_variables();
@@ -180,9 +180,8 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
*/
ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
- :handler(hton, NULL), m_part_info(part_info),
- m_create_handler(TRUE),
- m_is_sub_partitioned(m_part_info->is_sub_partitioned()), is_clone(FALSE)
+ :handler(hton, NULL), m_part_info(part_info), m_create_handler(TRUE),
+ m_is_sub_partitioned(m_part_info->is_sub_partitioned())
{
DBUG_ENTER("ha_partition::ha_partition(part_info)");
init_handler_variables();
@@ -192,7 +191,7 @@ ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
/*
- Initialise handler object
+ Initialize handler object
SYNOPSIS
init_handler_variables()
@@ -229,7 +228,7 @@ void ha_partition::init_handler_variables()
m_innodb= FALSE;
m_extra_cache= FALSE;
m_extra_cache_size= 0;
- m_table_flags= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
+ m_handler_status= handler_not_initialized;
m_low_byte_first= 1;
m_part_field_array= NULL;
m_ordered_rec_buffer= NULL;
@@ -237,7 +236,11 @@ void ha_partition::init_handler_variables()
m_rec_length= 0;
m_last_part= 0;
m_rec0= 0;
- m_curr_key_info= 0;
+ m_curr_key_info[0]= NULL;
+ m_curr_key_info[1]= NULL;
+ is_clone= FALSE,
+ auto_increment_lock= FALSE;
+ auto_increment_safe_stmt_log_lock= FALSE;
/*
this allows blackhole to work properly
*/
@@ -284,10 +287,10 @@ ha_partition::~ha_partition()
/*
- Initialise partition handler object
+ Initialize partition handler object
SYNOPSIS
- initialise_partition()
+ initialize_partition()
mem_root Allocate memory through this
RETURN VALUE
@@ -317,8 +320,8 @@ ha_partition::~ha_partition()
normal storage engine
The flag HA_FILE_BASED will be set independent of the underlying handlers
4) Index flags initialisation
- When knowledge exists on the indexes it is also possible to initialise the
- index flags. Again the index flags must be initialised by using the under-
+ When knowledge exists on the indexes it is also possible to initialize the
+ index flags. Again the index flags must be initialized by using the under-
lying handlers since this is storage engine dependent.
The flag HA_READ_ORDER will be reset for the time being to indicate no
ordered output is available from partition handler indexes. Later a merge
@@ -328,10 +331,11 @@ ha_partition::~ha_partition()
*/
-bool ha_partition::initialise_partition(MEM_ROOT *mem_root)
+bool ha_partition::initialize_partition(MEM_ROOT *mem_root)
{
handler **file_array, *file;
- DBUG_ENTER("ha_partition::initialise_partition");
+ ulonglong check_table_flags;
+ DBUG_ENTER("ha_partition::initialize_partition");
if (m_create_handler)
{
@@ -343,11 +347,9 @@ bool ha_partition::initialise_partition(MEM_ROOT *mem_root)
else if (!table_share || !table_share->normalized_path.str)
{
/*
- Called with dummy table share (delete, rename and alter table)
- Don't need to set-up table flags other than
- HA_FILE_BASED here
+ Called with dummy table share (delete, rename and alter table).
+ Don't need to set-up anything.
*/
- m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
DBUG_RETURN(0);
}
else if (get_from_handler_file(table_share->normalized_path.str, mem_root))
@@ -359,15 +361,12 @@ bool ha_partition::initialise_partition(MEM_ROOT *mem_root)
We create all underlying table handlers here. We do it in this special
method to be able to report allocation errors.
- Set up table_flags, low_byte_first, primary_key_is_clustered and
+ Set up low_byte_first, primary_key_is_clustered and
has_transactions since they are called often in all kinds of places,
other parameters are calculated on demand.
- HA_FILE_BASED is always set for partition handler since we use a
- special file for handling names of partitions, engine types.
- HA_CAN_GEOMETRY, HA_CAN_FULLTEXT, HA_CAN_SQL_HANDLER, HA_DUPLICATE_POS,
- HA_CAN_INSERT_DELAYED is disabled until further investigated.
+ Verify that all partitions have the same table_flags.
*/
- m_table_flags= (ulong)m_file[0]->ha_table_flags();
+ check_table_flags= m_file[0]->ha_table_flags();
m_low_byte_first= m_file[0]->low_byte_first();
m_pkey_is_clustered= TRUE;
file_array= m_file;
@@ -382,12 +381,13 @@ bool ha_partition::initialise_partition(MEM_ROOT *mem_root)
}
if (!file->primary_key_is_clustered())
m_pkey_is_clustered= FALSE;
- m_table_flags&= file->ha_table_flags();
+ if (check_table_flags != file->ha_table_flags())
+ {
+ my_error(ER_MIX_HANDLER_ERROR, MYF(0));
+ DBUG_RETURN(1);
+ }
} while (*(++file_array));
- m_table_flags&= ~(HA_CAN_GEOMETRY | HA_CAN_FULLTEXT | HA_DUPLICATE_POS |
- HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED |
- HA_PRIMARY_KEY_REQUIRED_FOR_POSITION);
- m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
+ m_handler_status= handler_initialized;
DBUG_RETURN(0);
}
@@ -874,10 +874,7 @@ int ha_partition::optimize(THD *thd, HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("ha_partition::optimize");
- DBUG_RETURN(handle_opt_partitions(thd, check_opt,
- OPTIMIZE_PARTS,
- thd->lex->alter_info.flags &
- ALTER_OPTIMIZE_PARTITION ? FALSE : TRUE));
+ DBUG_RETURN(handle_opt_partitions(thd, check_opt, OPTIMIZE_PARTS));
}
@@ -898,10 +895,7 @@ int ha_partition::analyze(THD *thd, HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("ha_partition::analyze");
- DBUG_RETURN(handle_opt_partitions(thd, check_opt,
- ANALYZE_PARTS,
- thd->lex->alter_info.flags &
- ALTER_ANALYZE_PARTITION ? FALSE : TRUE));
+ DBUG_RETURN(handle_opt_partitions(thd, check_opt, ANALYZE_PARTS));
}
@@ -922,10 +916,7 @@ int ha_partition::check(THD *thd, HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("ha_partition::check");
- DBUG_RETURN(handle_opt_partitions(thd, check_opt,
- CHECK_PARTS,
- thd->lex->alter_info.flags &
- ALTER_CHECK_PARTITION ? FALSE : TRUE));
+ DBUG_RETURN(handle_opt_partitions(thd, check_opt, CHECK_PARTS));
}
@@ -946,12 +937,10 @@ int ha_partition::repair(THD *thd, HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("ha_partition::repair");
- DBUG_RETURN(handle_opt_partitions(thd, check_opt,
- REPAIR_PARTS,
- thd->lex->alter_info.flags &
- ALTER_REPAIR_PARTITION ? FALSE : TRUE));
+ DBUG_RETURN(handle_opt_partitions(thd, check_opt, REPAIR_PARTS));
}
+
/*
Handle optimize/analyze/check/repair of one partition
@@ -1054,7 +1043,6 @@ static bool print_admin_msg(THD* thd, const char* msg_type,
thd Thread object
check_opt Options
flag Optimize/Analyze/Check/Repair flag
- all_parts All partitions or only a subset
RETURN VALUE
>0 Failure
@@ -1062,7 +1050,7 @@ static bool print_admin_msg(THD* thd, const char* msg_type,
*/
int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
- uint flag, bool all_parts)
+ uint flag)
{
List_iterator<partition_element> part_it(m_part_info->partitions);
uint no_parts= m_part_info->no_parts;
@@ -1070,7 +1058,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
uint i= 0;
int error;
DBUG_ENTER("ha_partition::handle_opt_partitions");
- DBUG_PRINT("enter", ("all_parts %u, flag= %u", all_parts, flag));
+ DBUG_PRINT("enter", ("flag= %u", flag));
do
{
@@ -1079,7 +1067,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
when ALTER TABLE <CMD> PARTITION ...
it should only do named partitions, otherwise all partitions
*/
- if (all_parts ||
+ if (!(thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION) ||
part_elem->part_state == PART_CHANGED)
{
if (m_is_sub_partitioned)
@@ -1248,7 +1236,7 @@ int ha_partition::prepare_new_partition(TABLE *tbl,
assumes that external_lock() is last call that may fail here.
Otherwise see description for cleanup_new_partition().
*/
- if ((error= file->ha_external_lock(current_thd, m_lock_type)))
+ if ((error= file->ha_external_lock(ha_thd(), m_lock_type)))
goto error;
DBUG_RETURN(0);
@@ -1336,8 +1324,8 @@ void ha_partition::cleanup_new_partition(uint part_count)
int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data
__attribute__((unused)),
size_t pack_frm_len
@@ -1354,7 +1342,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
int error= 1;
bool first;
uint temp_partitions= m_part_info->temp_partitions.elements;
- THD *thd= current_thd;
+ THD *thd= ha_thd();
DBUG_ENTER("ha_partition::change_partitions");
/*
@@ -1628,7 +1616,8 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
partitions.
*/
-int ha_partition::copy_partitions(ulonglong *copied, ulonglong *deleted)
+int ha_partition::copy_partitions(ulonglong * const copied,
+ ulonglong * const deleted)
{
uint reorg_part= 0;
int result= 0;
@@ -1674,13 +1663,13 @@ int ha_partition::copy_partitions(ulonglong *copied, ulonglong *deleted)
table since it doesn't fit into any partition any longer due to
changed partitioning ranges or list values.
*/
- deleted++;
+ (*deleted)++;
}
else
{
THD *thd= ha_thd();
/* Copy record to new handler */
- copied++;
+ (*copied)++;
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
result= m_new_file[new_part]->ha_write_row(m_rec0);
reenable_binlog(thd);
@@ -1714,6 +1703,14 @@ error:
void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
{
+ /*
+ Fix for bug#38751, some engines needs info-calls in ALTER.
+ Archive need this since it flushes in ::info.
+ HA_STATUS_AUTO is optimized so it will not always be forwarded
+ to all partitions, but HA_STATUS_VARIABLE will.
+ */
+ info(HA_STATUS_VARIABLE);
+
info(HA_STATUS_AUTO);
if (!(create_info->used_fields & HA_CREATE_USED_AUTO))
@@ -1804,7 +1801,7 @@ uint ha_partition::del_ren_cre_table(const char *from,
handler **file, **abort_file;
DBUG_ENTER("del_ren_cre_table()");
- if (get_from_handler_file(from, current_thd->mem_root))
+ if (get_from_handler_file(from, ha_thd()->mem_root))
DBUG_RETURN(TRUE);
DBUG_ASSERT(m_file_buffer);
DBUG_PRINT("enter", ("from: (%s) to: (%s)", from, to));
@@ -1931,7 +1928,7 @@ int ha_partition::set_up_table_before_create(TABLE *tbl,
{
int error= 0;
const char *partition_name;
- THD *thd= current_thd;
+ THD *thd= ha_thd();
DBUG_ENTER("set_up_table_before_create");
if (!part_elem)
@@ -2327,7 +2324,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
tot_partition_words= (m_tot_parts + 3) / 4;
engine_array= (handlerton **) my_alloca(m_tot_parts * sizeof(handlerton*));
for (i= 0; i < m_tot_parts; i++)
- engine_array[i]= ha_resolve_by_legacy_type(current_thd,
+ engine_array[i]= ha_resolve_by_legacy_type(ha_thd(),
(enum legacy_db_type)
*(uchar *) ((file_buffer) + 12 + i));
address_tot_name_len= file_buffer + 12 + 4 * tot_partition_words;
@@ -2398,8 +2395,11 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
uint alloc_len;
handler **file;
char name_buff[FN_REFLEN];
+ bool is_not_tmp_table= (table_share->tmp_table == NO_TMP_TABLE);
+ ulonglong check_table_flags= 0;
DBUG_ENTER("ha_partition::open");
+ DBUG_ASSERT(table->s == table_share);
ref_length= 0;
m_mode= mode;
m_open_test_lock= test_if_locked;
@@ -2408,9 +2408,9 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(1);
m_start_key.length= 0;
m_rec0= table->record[0];
- m_rec_length= table->s->reclength;
+ m_rec_length= table_share->reclength;
alloc_len= m_tot_parts * (m_rec_length + PARTITION_BYTES_IN_POS);
- alloc_len+= table->s->max_key_length;
+ alloc_len+= table_share->max_key_length;
if (!m_ordered_rec_buffer)
{
if (!(m_ordered_rec_buffer= (uchar*)my_malloc(alloc_len, MYF(MY_WME))))
@@ -2436,7 +2436,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
}
}
- /* Initialise the bitmap we use to determine what partitions are used */
+ /* Initialize the bitmap we use to determine what partitions are used */
if (!is_clone)
{
if (bitmap_init(&(m_part_info->used_partitions), NULL, m_tot_parts, TRUE))
@@ -2444,8 +2444,6 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
bitmap_set_all(&(m_part_info->used_partitions));
}
- /* Recalculate table flags as they may change after open */
- m_table_flags= m_file[0]->ha_table_flags();
file= m_file;
do
{
@@ -2457,11 +2455,24 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
m_no_locks+= (*file)->lock_count();
name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
set_if_bigger(ref_length, ((*file)->ref_length));
- m_table_flags&= (*file)->ha_table_flags();
+ /*
+ Verify that all partitions have the same set of table flags.
+ Mask all flags that partitioning enables/disables.
+ */
+ if (!check_table_flags)
+ {
+ check_table_flags= (((*file)->ha_table_flags() &
+ ~(PARTITION_DISABLED_TABLE_FLAGS)) |
+ (PARTITION_ENABLED_TABLE_FLAGS));
+ }
+ else if (check_table_flags != (((*file)->ha_table_flags() &
+ ~(PARTITION_DISABLED_TABLE_FLAGS)) |
+ (PARTITION_ENABLED_TABLE_FLAGS)))
+ {
+ error= HA_ERR_INITIALIZATION;
+ goto err_handler;
+ }
} while (*(++file));
- m_table_flags&= ~(HA_CAN_GEOMETRY | HA_CAN_FULLTEXT | HA_DUPLICATE_POS |
- HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED);
- m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
key_used_on_scan= m_file[0]->key_used_on_scan;
implicit_emptied= m_file[0]->implicit_emptied;
/*
@@ -2476,18 +2487,43 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
*/
clear_handler_file();
/*
- Initialise priority queue, initialised to reading forward.
+ Initialize priority queue, initialized to reading forward.
*/
if ((error= init_queue(&m_queue, m_tot_parts, (uint) PARTITION_BYTES_IN_POS,
0, key_rec_cmp, (void*)this)))
goto err_handler;
/*
+ Use table_share->ha_data to share auto_increment_value among all handlers
+ for the same table.
+ */
+ if (is_not_tmp_table)
+ pthread_mutex_lock(&table_share->mutex);
+ if (!table_share->ha_data)
+ {
+ HA_DATA_PARTITION *ha_data;
+ /* currently only needed for auto_increment */
+ table_share->ha_data= ha_data= (HA_DATA_PARTITION*)
+ alloc_root(&table_share->mem_root,
+ sizeof(HA_DATA_PARTITION));
+ if (!ha_data)
+ {
+ if (is_not_tmp_table)
+ pthread_mutex_unlock(&table_share->mutex);
+ goto err_handler;
+ }
+ DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data));
+ bzero(ha_data, sizeof(HA_DATA_PARTITION));
+ }
+ if (is_not_tmp_table)
+ pthread_mutex_unlock(&table_share->mutex);
+ /*
Some handlers update statistics as part of the open call. This will in
some cases corrupt the statistics of the partition handler and thus
to ensure we have correct statistics we call info from open after
calling open on all individual handlers.
*/
+ m_handler_status= handler_opened;
info(HA_STATUS_VARIABLE | HA_STATUS_CONST);
DBUG_RETURN(0);
@@ -2539,6 +2575,7 @@ int ha_partition::close(void)
handler **file;
DBUG_ENTER("ha_partition::close");
+ DBUG_ASSERT(table->s == table_share);
delete_queue(&m_queue);
if (!is_clone)
bitmap_free(&(m_part_info->used_partitions));
@@ -2557,6 +2594,7 @@ repeat:
goto repeat;
}
+ m_handler_status= handler_closed;
DBUG_RETURN(0);
}
@@ -2607,6 +2645,7 @@ int ha_partition::external_lock(THD *thd, int lock_type)
handler **file;
DBUG_ENTER("ha_partition::external_lock");
+ DBUG_ASSERT(!auto_increment_lock && !auto_increment_safe_stmt_log_lock);
file= m_file;
m_lock_type= lock_type;
@@ -2825,8 +2864,9 @@ int ha_partition::write_row(uchar * buf)
uint32 part_id;
int error;
longlong func_value;
- bool autoincrement_lock= FALSE;
+ bool have_auto_increment= table->next_number_field && buf == table->record[0];
my_bitmap_map *old_map;
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
THD *thd= ha_thd();
timestamp_auto_set_type orig_timestamp_type= table->timestamp_field_type;
#ifdef NOT_NEEDED
@@ -2844,28 +2884,16 @@ int ha_partition::write_row(uchar * buf)
If we have an auto_increment column and we are writing a changed row
or a new row, then update the auto_increment value in the record.
*/
- if (table->next_number_field && buf == table->record[0])
+ if (have_auto_increment)
{
- /*
- Some engines (InnoDB for example) can change autoincrement
- counter only after 'table->write_row' operation.
- So if another thread gets inside the ha_partition::write_row
- before it is complete, it gets same auto_increment value,
- which means DUP_KEY error (bug #27405)
- Here we separate the access using table_share->mutex, and
- use autoincrement_lock variable to avoid unnecessary locks.
- Probably not an ideal solution.
- */
- if (table_share->tmp_table == NO_TMP_TABLE)
+ if (!ha_data->auto_inc_initialized &&
+ !table->s->next_number_keypart)
{
/*
- Bug#30878 crash when alter table from non partitioned table
- to partitioned.
- Checking if tmp table then there is no need to lock,
- and the table_share->mutex may not be initialised.
+ If auto_increment in table_share is not initialized, start by
+ initializing it.
*/
- autoincrement_lock= TRUE;
- pthread_mutex_lock(&table_share->mutex);
+ info(HA_STATUS_AUTO);
}
error= update_auto_increment();
@@ -2903,11 +2931,11 @@ int ha_partition::write_row(uchar * buf)
DBUG_PRINT("info", ("Insert in partition %d", part_id));
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
error= m_file[part_id]->ha_write_row(buf);
+ if (have_auto_increment && !table->s->next_number_keypart)
+ set_auto_increment_if_higher(table->next_number_field->val_int());
reenable_binlog(thd);
exit:
table->timestamp_field_type= orig_timestamp_type;
- if (autoincrement_lock)
- pthread_mutex_unlock(&table_share->mutex);
DBUG_RETURN(error);
}
@@ -2931,13 +2959,6 @@ exit:
Keep in mind that the server can do updates based on ordering if an
ORDER BY clause was used. Consecutive ordering is not guarenteed.
- Currently new_data will not have an updated auto_increament record, or
- and updated timestamp field. You can do these for partition by doing these:
- if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
- table->timestamp_field->set_time();
- if (table->next_number_field && record == table->record[0])
- update_auto_increment();
-
Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
new_data is always record[0]
old_data is normally record[1] but may be anything
@@ -2969,11 +2990,6 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
goto exit;
}
- /*
- TODO:
- set_internal_auto_increment=
- max(set_internal_auto_increment, new_data->auto_increment)
- */
m_last_part= new_part_id;
if (new_part_id == old_part_id)
{
@@ -3006,6 +3022,22 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
}
exit:
+ /*
+ if updating an auto_increment column, update
+ table_share->ha_data->next_auto_inc_val if needed.
+ (not to be used if auto_increment on secondary field in a multi-column
+ index)
+ mysql_update does not set table->next_number_field, so we use
+ table->found_next_number_field instead.
+ */
+ if (table->found_next_number_field && new_data == table->record[0] &&
+ !table->s->next_number_keypart)
+ {
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ if (!ha_data->auto_inc_initialized)
+ info(HA_STATUS_AUTO);
+ set_auto_increment_if_higher(table->found_next_number_field->val_int());
+ }
table->timestamp_field_type= orig_timestamp_type;
DBUG_RETURN(error);
}
@@ -3084,8 +3116,17 @@ int ha_partition::delete_all_rows()
{
int error;
handler **file;
+ THD *thd= ha_thd();
DBUG_ENTER("ha_partition::delete_all_rows");
+ if (thd->lex->sql_command == SQLCOM_TRUNCATE)
+ {
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ lock_auto_increment();
+ ha_data->next_auto_inc_val= 0;
+ ha_data->auto_inc_initialized= FALSE;
+ unlock_auto_increment();
+ }
file= m_file;
do
{
@@ -3544,7 +3585,7 @@ int ha_partition::rnd_pos_by_record(uchar *record)
*/
/*
- Initialise handler before start of index scan
+ Initialize handler before start of index scan
SYNOPSIS
index_init()
@@ -3566,11 +3607,24 @@ int ha_partition::index_init(uint inx, bool sorted)
handler **file;
DBUG_ENTER("ha_partition::index_init");
+ DBUG_PRINT("info", ("inx %u sorted %u", inx, sorted));
active_index= inx;
m_part_spec.start_part= NO_CURRENT_PART_ID;
m_start_key.length= 0;
m_ordered= sorted;
- m_curr_key_info= table->key_info+inx;
+ m_curr_key_info[0]= table->key_info+inx;
+ if (m_pkey_is_clustered && table->s->primary_key != MAX_KEY)
+ {
+ /*
+ if PK is clustered, then the key cmp must use the pk to
+ differentiate between equal key in given index.
+ */
+ DBUG_PRINT("info", ("Clustered pk, using pk as secondary cmp"));
+ m_curr_key_info[1]= table->key_info+table->s->primary_key;
+ m_curr_key_info[2]= NULL;
+ }
+ else
+ m_curr_key_info[1]= NULL;
/*
Some handlers only read fields as specified by the bitmap for the
read set. For partitioned handlers we always require that the
@@ -3595,9 +3649,13 @@ int ha_partition::index_init(uint inx, bool sorted)
TODO: handle COUNT(*) queries via unordered scan.
*/
uint i;
- for (i= 0; i < m_curr_key_info->key_parts; i++)
- bitmap_set_bit(table->read_set,
- m_curr_key_info->key_part[i].field->field_index);
+ KEY **key_info= m_curr_key_info;
+ do
+ {
+ for (i= 0; i < (*key_info)->key_parts; i++)
+ bitmap_set_bit(table->read_set,
+ (*key_info)->key_part[i].field->field_index);
+ } while (*(++key_info));
}
file= m_file;
do
@@ -3654,10 +3712,10 @@ int ha_partition::index_end()
Read one record in an index scan and start an index scan
SYNOPSIS
- index_read()
+ index_read_map()
buf Read row in MySQL Row Format
key Key parts in consecutive order
- key_len Total length of key parts
+ keypart_map Which part of key is used
find_flag What type of key condition is used
RETURN VALUE
@@ -3665,12 +3723,12 @@ int ha_partition::index_end()
0 Success
DESCRIPTION
- index_read starts a new index scan using a start key. The MySQL Server
+ index_read_map starts a new index scan using a start key. The MySQL Server
will check the end key on its own. Thus to function properly the
partitioned handler need to ensure that it delivers records in the sort
order of the MySQL Server.
- index_read can be restarted without calling index_end on the previous
- index scan and without calling index_init. In this case the index_read
+ index_read_map can be restarted without calling index_end on the previous
+ index scan and without calling index_init. In this case the index_read_map
is on the same index as the previous index_scan. This is particularly
used in conjuntion with multi read ranges.
*/
@@ -3680,10 +3738,12 @@ int ha_partition::index_read_map(uchar *buf, const uchar *key,
enum ha_rkey_function find_flag)
{
DBUG_ENTER("ha_partition::index_read_map");
-
end_range= 0;
m_index_scan_type= partition_index_read;
- DBUG_RETURN(common_index_read(buf, key, keypart_map, find_flag));
+ m_start_key.key= key;
+ m_start_key.keypart_map= keypart_map;
+ m_start_key.flag= find_flag;
+ DBUG_RETURN(common_index_read(buf, TRUE));
}
@@ -3691,41 +3751,70 @@ int ha_partition::index_read_map(uchar *buf, const uchar *key,
Common routine for a number of index_read variants
SYNOPSIS
- common_index_read
-
- see index_read for rest
+ ha_partition::common_index_read()
+ buf Buffer where the record should be returned
+ have_start_key TRUE <=> the left endpoint is available, i.e.
+ we're in index_read call or in read_range_first
+ call and the range has left endpoint
+
+ FALSE <=> there is no left endpoint (we're in
+ read_range_first() call and the range has no left
+ endpoint)
+
+ DESCRIPTION
+ Start scanning the range (when invoked from read_range_first()) or doing
+ an index lookup (when invoked from index_read_XXX):
+ - If possible, perform partition selection
+ - Find the set of partitions we're going to use
+ - Depending on whether we need ordering:
+ NO: Get the first record from first used partition (see
+ handle_unordered_scan_next_partition)
+ YES: Fill the priority queue and get the record that is the first in
+ the ordering
+
+ RETURN
+ 0 OK
+ other HA_ERR_END_OF_FILE or other error code.
*/
-int ha_partition::common_index_read(uchar *buf, const uchar *key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_partition::common_index_read(uchar *buf, bool have_start_key)
{
int error;
+ uint key_len;
bool reverse_order= FALSE;
- uint key_len= calculate_key_len(table, active_index, key, keypart_map);
DBUG_ENTER("ha_partition::common_index_read");
+ LINT_INIT(key_len); /* used if have_start_key==TRUE */
- memcpy((void*)m_start_key.key, key, key_len);
- m_start_key.keypart_map= keypart_map;
- m_start_key.length= key_len;
- m_start_key.flag= find_flag;
+ DBUG_PRINT("info", ("m_ordered %u m_ordered_scan_ong %u have_start_key %u",
+ m_ordered, m_ordered_scan_ongoing, have_start_key));
- if ((error= partition_scan_set_up(buf, TRUE)))
+ if (have_start_key)
+ {
+ m_start_key.length= key_len= calculate_key_len(table, active_index,
+ m_start_key.key,
+ m_start_key.keypart_map);
+ DBUG_ASSERT(key_len);
+ }
+ if ((error= partition_scan_set_up(buf, have_start_key)))
{
DBUG_RETURN(error);
}
- if (find_flag == HA_READ_PREFIX_LAST ||
- find_flag == HA_READ_PREFIX_LAST_OR_PREV ||
- find_flag == HA_READ_BEFORE_KEY)
+
+ if (have_start_key &&
+ (m_start_key.flag == HA_READ_PREFIX_LAST ||
+ m_start_key.flag == HA_READ_PREFIX_LAST_OR_PREV ||
+ m_start_key.flag == HA_READ_BEFORE_KEY))
{
reverse_order= TRUE;
m_ordered_scan_ongoing= TRUE;
}
+ DBUG_PRINT("info", ("m_ordered %u m_o_scan_ong %u have_start_key %u",
+ m_ordered, m_ordered_scan_ongoing, have_start_key));
if (!m_ordered_scan_ongoing ||
- (find_flag == HA_READ_KEY_EXACT &&
- (key_len >= m_curr_key_info->key_length ||
- key_len == 0)))
- {
+ (have_start_key && m_start_key.flag == HA_READ_KEY_EXACT &&
+ !m_pkey_is_clustered &&
+ key_len >= m_curr_key_info[0]->key_length))
+ {
/*
We use unordered index scan either when read_range is used and flag
is set to not use ordered or when an exact key is used and in this
@@ -3737,6 +3826,7 @@ int ha_partition::common_index_read(uchar *buf, const uchar *key,
Need to set unordered scan ongoing since we can come here even when
it isn't set.
*/
+ DBUG_PRINT("info", ("doing unordered scan"));
m_ordered_scan_ongoing= FALSE;
error= handle_unordered_scan_next_partition(buf);
}
@@ -3816,7 +3906,7 @@ int ha_partition::index_last(uchar * buf)
Common routine for index_first/index_last
SYNOPSIS
- common_index_first_last
+ ha_partition::common_first_last()
see index_first for rest
*/
@@ -3838,7 +3928,7 @@ int ha_partition::common_first_last(uchar *buf)
Read last using key
SYNOPSIS
- index_read_last()
+ index_read_last_map()
buf Read row in MySQL Row Format
key Key
keypart_map Which part of key is used
@@ -3860,7 +3950,10 @@ int ha_partition::index_read_last_map(uchar *buf, const uchar *key,
m_ordered= TRUE; // Safety measure
end_range= 0;
m_index_scan_type= partition_index_read_last;
- DBUG_RETURN(common_index_read(buf, key, keypart_map, HA_READ_PREFIX_LAST));
+ m_start_key.key= key;
+ m_start_key.keypart_map= keypart_map;
+ m_start_key.flag= HA_READ_PREFIX_LAST;
+ DBUG_RETURN(common_index_read(buf, TRUE));
}
@@ -3991,23 +4084,15 @@ int ha_partition::read_range_first(const key_range *start_key,
((end_key->flag == HA_READ_BEFORE_KEY) ? 1 :
(end_key->flag == HA_READ_AFTER_KEY) ? -1 : 0);
}
- range_key_part= m_curr_key_info->key_part;
- if (!start_key) // Read first record
- {
- if (m_ordered)
- m_index_scan_type= partition_index_first;
- else
- m_index_scan_type= partition_index_first_unordered;
- error= common_first_last(m_rec0);
- }
+ range_key_part= m_curr_key_info[0]->key_part;
+ if (start_key)
+ m_start_key= *start_key;
else
- {
- m_index_scan_type= partition_index_read;
- error= common_index_read(m_rec0,
- start_key->key,
- start_key->keypart_map, start_key->flag);
- }
+ m_start_key.key= NULL;
+
+ m_index_scan_type= partition_read_range;
+ error= common_index_read(m_rec0, test(start_key));
DBUG_RETURN(error);
}
@@ -4027,28 +4112,38 @@ int ha_partition::read_range_next()
{
DBUG_ENTER("ha_partition::read_range_next");
- if (m_ordered)
+ if (m_ordered_scan_ongoing)
{
- DBUG_RETURN(handler::read_range_next());
+ DBUG_RETURN(handle_ordered_next(table->record[0], eq_range));
}
- DBUG_RETURN(handle_unordered_next(m_rec0, eq_range));
+ DBUG_RETURN(handle_unordered_next(table->record[0], eq_range));
}
/*
- Common routine to set up scans
+ Common routine to set up index scans
SYNOPSIS
- buf Buffer to later return record in
- idx_read_flag Is it index scan
+ ha_partition::partition_scan_set_up()
+ buf Buffer to later return record in (this function
+ needs it to calculcate partitioning function
+ values)
+
+ idx_read_flag TRUE <=> m_start_key has range start endpoint which
+ probably can be used to determine the set of partitions
+ to scan.
+ FALSE <=> there is no start endpoint.
+
+ DESCRIPTION
+ Find out which partitions we'll need to read when scanning the specified
+ range.
+
+ If we need to scan only one partition, set m_ordered_scan_ongoing=FALSE
+ as we will not need to do merge ordering.
RETURN VALUE
>0 Error code
0 Success
-
- DESCRIPTION
- This is where we check which partitions to actually scan if not all
- of them
*/
int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
@@ -4139,10 +4234,19 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
DBUG_ENTER("ha_partition::handle_unordered_next");
/*
- We should consider if this should be split into two functions as
- next_same is alwas a local constant
+ We should consider if this should be split into three functions as
+ partition_read_range is_next_same are always local constants
*/
- if (is_next_same)
+
+ if (m_index_scan_type == partition_read_range)
+ {
+ if (!(error= file->read_range_next()))
+ {
+ m_last_part= m_part_spec.start_part;
+ DBUG_RETURN(0);
+ }
+ }
+ else if (is_next_same)
{
if (!(error= file->index_next_same(buf, m_start_key.key,
m_start_key.length)))
@@ -4151,15 +4255,13 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
DBUG_RETURN(0);
}
}
- else if (!(error= file->index_next(buf)))
+ else
{
- if (!(file->index_flags(active_index, 0, 1) & HA_READ_ORDER) ||
- compare_key(end_range) <= 0)
+ if (!(error= file->index_next(buf)))
{
m_last_part= m_part_spec.start_part;
DBUG_RETURN(0); // Row was in range
}
- error= HA_ERR_END_OF_FILE;
}
if (error == HA_ERR_END_OF_FILE)
@@ -4203,6 +4305,11 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
file= m_file[i];
m_part_spec.start_part= i;
switch (m_index_scan_type) {
+ case partition_read_range:
+ DBUG_PRINT("info", ("read_range_first on partition %d", i));
+ error= file->read_range_first(m_start_key.key? &m_start_key: NULL,
+ end_range, eq_range, FALSE);
+ break;
case partition_index_read:
DBUG_PRINT("info", ("index_read on partition %d", i));
error= file->index_read_map(buf, m_start_key.key,
@@ -4211,6 +4318,17 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
break;
case partition_index_first:
DBUG_PRINT("info", ("index_first on partition %d", i));
+ /* MyISAM engine can fail if we call index_first() when indexes disabled */
+ /* that happens if the table is empty. */
+ /* Here we use file->stats.records instead of file->records() because */
+ /* file->records() is supposed to return an EXACT count, and it can be */
+ /* possibly slow. We don't need an exact number, an approximate one- from*/
+ /* the last ::info() call - is sufficient. */
+ if (file->stats.records == 0)
+ {
+ error= HA_ERR_END_OF_FILE;
+ break;
+ }
error= file->index_first(buf);
break;
case partition_index_first_unordered:
@@ -4231,13 +4349,8 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
}
if (!error)
{
- if (!(file->index_flags(active_index, 0, 1) & HA_READ_ORDER) ||
- compare_key(end_range) <= 0)
- {
- m_last_part= i;
- DBUG_RETURN(0);
- }
- error= HA_ERR_END_OF_FILE;
+ m_last_part= i;
+ DBUG_RETURN(0);
}
if ((error != HA_ERR_END_OF_FILE) && (error != HA_ERR_KEY_NOT_FOUND))
DBUG_RETURN(error);
@@ -4303,10 +4416,32 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
m_start_key.flag);
break;
case partition_index_first:
+ /* MyISAM engine can fail if we call index_first() when indexes disabled */
+ /* that happens if the table is empty. */
+ /* Here we use file->stats.records instead of file->records() because */
+ /* file->records() is supposed to return an EXACT count, and it can be */
+ /* possibly slow. We don't need an exact number, an approximate one- from*/
+ /* the last ::info() call - is sufficient. */
+ if (file->stats.records == 0)
+ {
+ error= HA_ERR_END_OF_FILE;
+ break;
+ }
error= file->index_first(rec_buf_ptr);
reverse_order= FALSE;
break;
case partition_index_last:
+ /* MyISAM engine can fail if we call index_last() when indexes disabled */
+ /* that happens if the table is empty. */
+ /* Here we use file->stats.records instead of file->records() because */
+ /* file->records() is supposed to return an EXACT count, and it can be */
+ /* possibly slow. We don't need an exact number, an approximate one- from*/
+ /* the last ::info() call - is sufficient. */
+ if (file->stats.records == 0)
+ {
+ error= HA_ERR_END_OF_FILE;
+ break;
+ }
error= file->index_last(rec_buf_ptr);
reverse_order= TRUE;
break;
@@ -4316,6 +4451,17 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
m_start_key.keypart_map);
reverse_order= TRUE;
break;
+ case partition_read_range:
+ {
+ /*
+ This can only read record to table->record[0], as it was set when
+ the table was being opened. We have to memcpy data ourselves.
+ */
+ error= file->read_range_first(&m_start_key, end_range, eq_range, TRUE);
+ memcpy(rec_buf_ptr, table->record[0], m_rec_length);
+ reverse_order= FALSE;
+ break;
+ }
default:
DBUG_ASSERT(FALSE);
DBUG_RETURN(HA_ERR_END_OF_FILE);
@@ -4324,7 +4470,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
{
found= TRUE;
/*
- Initialise queue without order first, simply insert
+ Initialize queue without order first, simply insert
*/
queue_element(&m_queue, j++)= (uchar*)queue_buf(i);
}
@@ -4396,8 +4542,13 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
uint part_id= m_top_entry;
handler *file= m_file[part_id];
DBUG_ENTER("ha_partition::handle_ordered_next");
-
- if (!is_next_same)
+
+ if (m_index_scan_type == partition_read_range)
+ {
+ error= file->read_range_next();
+ memcpy(rec_buf(part_id), table->record[0], m_rec_length);
+ }
+ else if (!is_next_same)
error= file->index_next(rec_buf(part_id));
else
error= file->index_next_same(rec_buf(part_id), m_start_key.key,
@@ -4545,21 +4696,54 @@ int ha_partition::handle_ordered_prev(uchar *buf)
int ha_partition::info(uint flag)
{
- handler *file, **file_array;
- DBUG_ENTER("ha_partition:info");
+ DBUG_ENTER("ha_partition::info");
if (flag & HA_STATUS_AUTO)
{
- ulonglong auto_increment_value= 0;
+ bool auto_inc_is_first_in_idx= (table_share->next_number_keypart == 0);
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
- file_array= m_file;
- do
+ if (!table->found_next_number_field)
+ stats.auto_increment_value= 0;
+ else if (ha_data->auto_inc_initialized)
{
- file= *file_array;
- file->info(HA_STATUS_AUTO);
- set_if_bigger(auto_increment_value, file->stats.auto_increment_value);
- } while (*(++file_array));
- stats.auto_increment_value= auto_increment_value;
+ lock_auto_increment();
+ stats.auto_increment_value= ha_data->next_auto_inc_val;
+ unlock_auto_increment();
+ }
+ else
+ {
+ lock_auto_increment();
+ /* to avoid two concurrent initializations, check again when locked */
+ if (ha_data->auto_inc_initialized)
+ stats.auto_increment_value= ha_data->next_auto_inc_val;
+ else
+ {
+ handler *file, **file_array;
+ ulonglong auto_increment_value= 0;
+ file_array= m_file;
+ DBUG_PRINT("info",
+ ("checking all partitions for auto_increment_value"));
+ do
+ {
+ file= *file_array;
+ file->info(HA_STATUS_AUTO);
+ set_if_bigger(auto_increment_value,
+ file->stats.auto_increment_value);
+ } while (*(++file_array));
+
+ DBUG_ASSERT(auto_increment_value);
+ stats.auto_increment_value= auto_increment_value;
+ if (auto_inc_is_first_in_idx)
+ {
+ set_if_bigger(ha_data->next_auto_inc_val, auto_increment_value);
+ ha_data->auto_inc_initialized= TRUE;
+ DBUG_PRINT("info", ("initializing next_auto_inc_val to %lu",
+ (ulong) ha_data->next_auto_inc_val));
+ }
+ }
+ unlock_auto_increment();
+ }
}
if (flag & HA_STATUS_VARIABLE)
{
@@ -4583,6 +4767,7 @@ int ha_partition::info(uint flag)
check_time: Time of last check (only applicable to MyISAM)
We report last time of all underlying handlers
*/
+ handler *file, **file_array;
stats.records= 0;
stats.deleted= 0;
stats.data_file_length= 0;
@@ -4606,7 +4791,7 @@ int ha_partition::info(uint flag)
}
} while (*(++file_array));
if (stats.records < 2 &&
- !(m_table_flags & HA_STATS_RECORDS_IS_EXACT))
+ !(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
stats.records= 2;
if (stats.records > 0)
stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records);
@@ -4664,6 +4849,7 @@ int ha_partition::info(uint flag)
So we calculate these constants by using the variables on the first
handler.
*/
+ handler *file;
file= m_file[0];
file->info(HA_STATUS_CONST);
@@ -4685,6 +4871,7 @@ int ha_partition::info(uint flag)
}
if (flag & HA_STATUS_TIME)
{
+ handler *file, **file_array;
DBUG_PRINT("info", ("info: HA_STATUS_TIME"));
/*
This flag is used to set the latest update time of the table.
@@ -4978,7 +5165,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
5) Parameters only used by MyISAM internally
--------------------------------------------
HA_EXTRA_REINIT_CACHE:
- This call reinitialises the READ CACHE described above if there is one
+ This call reinitializes the READ CACHE described above if there is one
and otherwise the call is ignored.
We can thus safely call it on all underlying handlers if they are
@@ -5060,7 +5247,6 @@ int ha_partition::extra(enum ha_extra_function operation)
DBUG_RETURN(prepare_for_rename());
case HA_EXTRA_NORMAL:
case HA_EXTRA_QUICK:
- case HA_EXTRA_NO_READCHECK:
case HA_EXTRA_PREPARE_FOR_UPDATE:
case HA_EXTRA_FORCE_REOPEN:
case HA_EXTRA_PREPARE_FOR_DROP:
@@ -5069,6 +5255,14 @@ int ha_partition::extra(enum ha_extra_function operation)
DBUG_RETURN(loop_extra(operation));
break;
}
+ case HA_EXTRA_NO_READCHECK:
+ {
+ /*
+ This is only done as a part of ha_open, which is also used in
+ ha_partition::open, so no need to do anything.
+ */
+ break;
+ }
case HA_EXTRA_CACHE:
{
prepare_extra_cache(0);
@@ -5600,6 +5794,89 @@ bool ha_partition::get_error_message(int error, String *buf)
/****************************************************************************
MODULE handler characteristics
****************************************************************************/
+/**
+ alter_table_flags must be on handler/table level, not on hton level
+ due to the ha_partition hton does not know what the underlying hton is.
+*/
+uint ha_partition::alter_table_flags(uint flags)
+{
+ DBUG_ENTER("ha_partition::alter_table_flags");
+ DBUG_RETURN(ht->alter_table_flags(flags) |
+ m_file[0]->alter_table_flags(flags));
+}
+
+
+/**
+ check if copy of data is needed in alter table.
+*/
+bool ha_partition::check_if_incompatible_data(HA_CREATE_INFO *create_info,
+ uint table_changes)
+{
+ handler **file;
+ bool ret= COMPATIBLE_DATA_YES;
+
+ /*
+ The check for any partitioning related changes have already been done
+ in mysql_alter_table (by fix_partition_func), so it is only up to
+ the underlying handlers.
+ */
+ for (file= m_file; *file; file++)
+ if ((ret= (*file)->check_if_incompatible_data(create_info,
+ table_changes)) !=
+ COMPATIBLE_DATA_YES)
+ break;
+ return ret;
+}
+
+
+/**
+ Support of fast or online add/drop index
+*/
+int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
+{
+ handler **file;
+ int ret= 0;
+
+ /*
+ There has already been a check in fix_partition_func in mysql_alter_table
+ before this call, which checks for unique/primary key violations of the
+ partitioning function. So no need for extra check here.
+ */
+ for (file= m_file; *file; file++)
+ if ((ret= (*file)->add_index(table_arg, key_info, num_of_keys)))
+ break;
+ return ret;
+}
+
+
+int ha_partition::prepare_drop_index(TABLE *table_arg, uint *key_num,
+ uint num_of_keys)
+{
+ handler **file;
+ int ret= 0;
+
+ /*
+ DROP INDEX does not affect partitioning.
+ */
+ for (file= m_file; *file; file++)
+ if ((ret= (*file)->prepare_drop_index(table_arg, key_num, num_of_keys)))
+ break;
+ return ret;
+}
+
+
+int ha_partition::final_drop_index(TABLE *table_arg)
+{
+ handler **file;
+ int ret= HA_ERR_WRONG_COMMAND;
+
+ for (file= m_file; *file; file++)
+ if ((ret= (*file)->final_drop_index(table_arg)))
+ break;
+ return ret;
+}
+
+
/*
If frm_error() is called then we will use this to to find out what file
extensions exist for the storage engine. This is also used by the default
@@ -5744,19 +6021,33 @@ int ha_partition::cmp_ref(const uchar *ref1, const uchar *ref2)
MODULE auto increment
****************************************************************************/
-void ha_partition::restore_auto_increment(ulonglong)
-{
- DBUG_ENTER("ha_partition::restore_auto_increment");
- DBUG_VOID_RETURN;
+int ha_partition::reset_auto_increment(ulonglong value)
+{
+ handler **file= m_file;
+ int res;
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ DBUG_ENTER("ha_partition::reset_auto_increment");
+ lock_auto_increment();
+ ha_data->auto_inc_initialized= FALSE;
+ ha_data->next_auto_inc_val= 0;
+ do
+ {
+ if ((res= (*file)->ha_reset_auto_increment(value)) != 0)
+ break;
+ } while (*(++file));
+ unlock_auto_increment();
+ DBUG_RETURN(res);
}
-/*
+/**
This method is called by update_auto_increment which in turn is called
- by the individual handlers as part of write_row. We will always let
- the first handler keep track of the auto increment value for all
- partitions.
+ by the individual handlers as part of write_row. We use the
+ table_share->ha_data->next_auto_inc_val, or search all
+ partitions for the highest auto_increment_value if not initialized or
+ if auto_increment field is a secondary part of a key, we must search
+ every partition when holding a mutex to be sure of correctness.
*/
void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
@@ -5764,59 +6055,88 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong *first_value,
ulonglong *nb_reserved_values)
{
- ulonglong first_value_part, last_value_part, nb_reserved_values_part,
- last_value= ~ (ulonglong) 0;
- handler **pos, **end;
- bool retry= TRUE;
DBUG_ENTER("ha_partition::get_auto_increment");
-
-again:
- for (pos=m_file, end= m_file+ m_tot_parts; pos != end ; pos++)
+ DBUG_PRINT("info", ("offset: %lu inc: %lu desired_values: %lu "
+ "first_value: %lu", (ulong) offset, (ulong) increment,
+ (ulong) nb_desired_values, (ulong) *first_value));
+ DBUG_ASSERT(increment && nb_desired_values);
+ *first_value= 0;
+ if (table->s->next_number_keypart)
{
- first_value_part= *first_value;
- (*pos)->get_auto_increment(offset, increment, nb_desired_values,
- &first_value_part, &nb_reserved_values_part);
- if (first_value_part == ~(ulonglong)(0)) // error in one partition
- {
- *first_value= first_value_part;
- sql_print_error("Partition failed to reserve auto_increment value");
- DBUG_VOID_RETURN;
- }
/*
- Partition has reserved an interval. Intersect it with the intervals
- already reserved for the previous partitions.
+ next_number_keypart is != 0 if the auto_increment column is a secondary
+ column in the index (it is allowed in MyISAM)
*/
- last_value_part= (nb_reserved_values_part == ULONGLONG_MAX) ?
- ULONGLONG_MAX : (first_value_part + nb_reserved_values_part * increment);
- set_if_bigger(*first_value, first_value_part);
- set_if_smaller(last_value, last_value_part);
+ DBUG_PRINT("info", ("next_number_keypart != 0"));
+ ulonglong nb_reserved_values_part;
+ ulonglong first_value_part, max_first_value;
+ handler **file= m_file;
+ first_value_part= max_first_value= *first_value;
+ /* Must lock and find highest value among all partitions. */
+ lock_auto_increment();
+ do
+ {
+ /* Only nb_desired_values = 1 makes sense */
+ (*file)->get_auto_increment(offset, increment, 1,
+ &first_value_part, &nb_reserved_values_part);
+ if (first_value_part == ~(ulonglong)(0)) // error in one partition
+ {
+ *first_value= first_value_part;
+ /* log that the error was between table/partition handler */
+ sql_print_error("Partition failed to reserve auto_increment value");
+ unlock_auto_increment();
+ DBUG_VOID_RETURN;
+ }
+ DBUG_PRINT("info", ("first_value_part: %lu", (ulong) first_value_part));
+ set_if_bigger(max_first_value, first_value_part);
+ } while (*(++file));
+ *first_value= max_first_value;
+ *nb_reserved_values= 1;
+ unlock_auto_increment();
}
- if (last_value < *first_value) /* empty intersection, error */
+ else
{
+ THD *thd= ha_thd();
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
/*
- When we have an empty intersection, it means that one or more
- partitions may have a significantly different autoinc next value.
- We should not fail here - it just means that we should try to
- find a new reservation making use of the current *first_value
- wbich should now be compatible with all partitions.
+ This is initialized in the beginning of the first write_row call.
*/
- if (retry)
- {
- retry= FALSE;
- last_value= ~ (ulonglong) 0;
- release_auto_increment();
- goto again;
- }
+ DBUG_ASSERT(ha_data->auto_inc_initialized);
/*
- We should not get here.
+ Get a lock for handling the auto_increment in table_share->ha_data
+ for avoiding two concurrent statements getting the same number.
+ */
+
+ lock_auto_increment();
+
+ /*
+ In a multi-row insert statement like INSERT SELECT and LOAD DATA
+ where the number of candidate rows to insert is not known in advance
+ we must hold a lock/mutex for the whole statement if we have statement
+ based replication. Because the statement-based binary log contains
+ only the first generated value used by the statement, and slaves assumes
+ all other generated values used by this statement were consecutive to
+ this first one, we must exclusively lock the generator until the statement
+ is done.
*/
- sql_print_error("Failed to calculate auto_increment value for partition");
-
- *first_value= ~(ulonglong)(0);
+ if (!auto_increment_safe_stmt_log_lock &&
+ thd->lex->sql_command != SQLCOM_INSERT &&
+ mysql_bin_log.is_open() &&
+ !thd->current_stmt_binlog_row_based &&
+ (thd->options & OPTION_BIN_LOG))
+ {
+ DBUG_PRINT("info", ("locking auto_increment_safe_stmt_log_lock"));
+ auto_increment_safe_stmt_log_lock= TRUE;
+ }
+
+ /* this gets corrected (for offset/increment) in update_auto_increment */
+ *first_value= ha_data->next_auto_inc_val;
+ ha_data->next_auto_inc_val+= nb_desired_values * increment;
+
+ unlock_auto_increment();
+ DBUG_PRINT("info", ("*first_value: %lu", (ulong) *first_value));
+ *nb_reserved_values= nb_desired_values;
}
- if (increment) // If not check for values
- *nb_reserved_values= (last_value == ULONGLONG_MAX) ?
- ULONGLONG_MAX : ((last_value - *first_value) / increment);
DBUG_VOID_RETURN;
}
@@ -5824,15 +6144,37 @@ void ha_partition::release_auto_increment()
{
DBUG_ENTER("ha_partition::release_auto_increment");
- for (uint i= 0; i < m_tot_parts; i++)
+ if (table->s->next_number_keypart)
{
- m_file[i]->ha_release_auto_increment();
+ for (uint i= 0; i < m_tot_parts; i++)
+ m_file[i]->ha_release_auto_increment();
+ }
+ else if (next_insert_id)
+ {
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ ulonglong next_auto_inc_val;
+ lock_auto_increment();
+ next_auto_inc_val= ha_data->next_auto_inc_val;
+ if (next_insert_id < next_auto_inc_val &&
+ auto_inc_interval_for_cur_row.maximum() >= next_auto_inc_val)
+ ha_data->next_auto_inc_val= next_insert_id;
+ DBUG_PRINT("info", ("ha_data->next_auto_inc_val: %lu",
+ (ulong) ha_data->next_auto_inc_val));
+
+ /* Unlock the multi row statement lock taken in get_auto_increment */
+ if (auto_increment_safe_stmt_log_lock)
+ {
+ auto_increment_safe_stmt_log_lock= FALSE;
+ DBUG_PRINT("info", ("unlocking auto_increment_safe_stmt_log_lock"));
+ }
+
+ unlock_auto_increment();
}
DBUG_VOID_RETURN;
}
/****************************************************************************
- MODULE initialise handler for HANDLER call
+ MODULE initialize handler for HANDLER call
****************************************************************************/
void ha_partition::init_table_handle_for_HANDLER()
@@ -5925,7 +6267,7 @@ int ha_partition::indexes_are_disabled(void)
-------------------------------------------------------------------------
Variables for partition share methods. A hash used to track open tables.
A mutex for the hash table and an init variable to check if hash table
- is initialised.
+ is initialized.
There is also a constant ending of the partition handler file name.
*/
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 99e3cb50a8f..07a16a8e423 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -37,8 +37,24 @@ typedef struct st_partition_share
} PARTITION_SHARE;
#endif
+/**
+ Partition specific ha_data struct.
+ @todo: move all partition specific data from TABLE_SHARE here.
+*/
+typedef struct st_ha_data_partition
+{
+ ulonglong next_auto_inc_val; /**< first non reserved value */
+ bool auto_inc_initialized;
+} HA_DATA_PARTITION;
#define PARTITION_BYTES_IN_POS 2
+#define PARTITION_ENABLED_TABLE_FLAGS (HA_FILE_BASED | HA_REC_NOT_IN_SEQ)
+#define PARTITION_DISABLED_TABLE_FLAGS (HA_CAN_GEOMETRY | \
+ HA_CAN_FULLTEXT | \
+ HA_DUPLICATE_POS | \
+ HA_CAN_SQL_HANDLER | \
+ HA_CAN_INSERT_DELAYED | \
+ HA_PRIMARY_KEY_REQUIRED_FOR_POSITION)
class ha_partition :public handler
{
private:
@@ -49,7 +65,8 @@ private:
partition_index_first_unordered= 2,
partition_index_last= 3,
partition_index_read_last= 4,
- partition_no_index_scan= 5
+ partition_read_range = 5,
+ partition_no_index_scan= 6
};
/* Data for the partition handler */
int m_mode; // Open mode
@@ -63,12 +80,17 @@ private:
handler **m_reorged_file; // Reorganised partitions
handler **m_added_file; // Added parts kept for errors
partition_info *m_part_info; // local reference to partition
- uchar *m_start_key_ref; // Reference of start key in current
- // index scan info
Field **m_part_field_array; // Part field array locally to save acc
- uchar *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan
- KEY *m_curr_key_info; // Current index
- uchar *m_rec0; // table->record[0]
+ uchar *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan
+ /*
+ Current index.
+ When used in key_rec_cmp: If clustered pk, index compare
+ must compare pk if given index is same for two rows.
+ So normally m_curr_key_info[0]= current index and m_curr_key[1]= NULL,
+ and if clustered pk, [0]= current index, [1]= pk, [2]= NULL
+ */
+ KEY *m_curr_key_info[3]; // Current index
+ uchar *m_rec0; // table->record[0]
QUEUE m_queue; // Prio queue used by sorted read
/*
Since the partition handler is a handler on top of other handlers, it
@@ -77,8 +99,15 @@ private:
for this since the MySQL Server sometimes allocating the handler object
without freeing them.
*/
- longlong m_table_flags;
ulong m_low_byte_first;
+ enum enum_handler_status
+ {
+ handler_not_initialized= 0,
+ handler_initialized,
+ handler_opened,
+ handler_closed
+ };
+ enum_handler_status m_handler_status;
uint m_reorged_parts; // Number of reorganised parts
uint m_tot_parts; // Total number of partitions;
@@ -141,6 +170,12 @@ private:
"own" the m_part_info structure.
*/
bool is_clone;
+ bool auto_increment_lock; /**< lock reading/updating auto_inc */
+ /**
+ Flag to keep the auto_increment lock through out the statement.
+ This to ensure it will work with statement based replication.
+ */
+ bool auto_increment_safe_stmt_log_lock;
public:
handler *clone(MEM_ROOT *mem_root);
virtual void set_part_info(partition_info *part_info)
@@ -168,7 +203,7 @@ public:
enable later calls of the methods to retrieve constants from the under-
lying handlers. Returns false if not successful.
*/
- bool initialise_partition(MEM_ROOT *mem_root);
+ bool initialize_partition(MEM_ROOT *mem_root);
/*
-------------------------------------------------------------------------
@@ -197,8 +232,8 @@ public:
virtual char *update_table_comment(const char *comment);
virtual int change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_frm_len);
virtual int drop_partitions(const char *path);
@@ -210,9 +245,11 @@ public:
DBUG_RETURN(0);
}
virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
+ virtual bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
+ uint table_changes);
private:
int prepare_for_rename();
- int copy_partitions(ulonglong *copied, ulonglong *deleted);
+ int copy_partitions(ulonglong * const copied, ulonglong * const deleted);
void cleanup_new_partition(uint part_count);
int prepare_new_partition(TABLE *table, HA_CREATE_INFO *create_info,
handler *file, const char *part_name,
@@ -429,9 +466,7 @@ public:
virtual int read_range_next();
private:
- int common_index_read(uchar * buf, const uchar * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag);
+ int common_index_read(uchar * buf, bool have_start_key);
int common_first_last(uchar * buf);
int partition_scan_set_up(uchar * buf, bool idx_read_flag);
int handle_unordered_next(uchar * buf, bool next_same);
@@ -573,6 +608,8 @@ public:
The partition handler will support whatever the underlying handlers
support except when specifically mentioned below about exceptions
to this rule.
+ NOTE: This cannot be cached since it can depend on TRANSACTION ISOLATION
+ LEVEL which is dynamic, see bug#39084.
HA_READ_RND_SAME:
Not currently used. (Means that the handler supports the rnd_same() call)
@@ -697,9 +734,33 @@ public:
transfer those calls into index_read and other calls in the
index scan module.
(NDB)
+
+ HA_PRIMARY_KEY_REQUIRED_FOR_POSITION:
+ Does the storage engine need a PK for position?
+ Used with hidden primary key in InnoDB.
+ Hidden primary keys cannot be supported by partitioning, since the
+ partitioning expressions columns must be a part of the primary key.
+ (InnoDB)
+
+ HA_FILE_BASED is always set for partition handler since we use a
+ special file for handling names of partitions, engine types.
+ HA_REC_NOT_IN_SEQ is always set for partition handler since we cannot
+ guarantee that the records will be returned in sequence.
+ HA_CAN_GEOMETRY, HA_CAN_FULLTEXT, HA_CAN_SQL_HANDLER, HA_DUPLICATE_POS,
+ HA_CAN_INSERT_DELAYED, HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is disabled
+ until further investigated.
*/
- virtual ulonglong table_flags() const
- { return m_table_flags; }
+ virtual Table_flags table_flags() const
+ {
+ DBUG_ENTER("ha_partition::table_flags");
+ if (m_handler_status < handler_initialized ||
+ m_handler_status >= handler_closed)
+ DBUG_RETURN(PARTITION_ENABLED_TABLE_FLAGS);
+ else
+ DBUG_RETURN((m_file[0]->ha_table_flags() &
+ ~(PARTITION_DISABLED_TABLE_FLAGS)) |
+ (PARTITION_ENABLED_TABLE_FLAGS));
+ }
/*
This is a bitmap of flags that says how the storage engine
@@ -762,6 +823,11 @@ public:
return m_file[0]->index_flags(inx, part, all_parts);
}
+ /**
+ wrapper function for handlerton alter_table_flags, since
+ the ha_partition_hton cannot know all its capabilities
+ */
+ virtual uint alter_table_flags(uint flags);
/*
extensions of table handler files
*/
@@ -829,16 +895,55 @@ public:
auto_increment_column_changed
-------------------------------------------------------------------------
*/
- virtual void restore_auto_increment(ulonglong prev_insert_id);
virtual void get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong nb_desired_values,
ulonglong *first_value,
ulonglong *nb_reserved_values);
virtual void release_auto_increment();
+private:
+ virtual int reset_auto_increment(ulonglong value);
+ virtual void lock_auto_increment()
+ {
+ /* lock already taken */
+ if (auto_increment_safe_stmt_log_lock)
+ return;
+ DBUG_ASSERT(table_share->ha_data && !auto_increment_lock);
+ if(table_share->tmp_table == NO_TMP_TABLE)
+ {
+ auto_increment_lock= TRUE;
+ pthread_mutex_lock(&table_share->mutex);
+ }
+ }
+ virtual void unlock_auto_increment()
+ {
+ DBUG_ASSERT(table_share->ha_data);
+ /*
+ If auto_increment_safe_stmt_log_lock is true, we have to keep the lock.
+ It will be set to false and thus unlocked at the end of the statement by
+ ha_partition::release_auto_increment.
+ */
+ if(auto_increment_lock && !auto_increment_safe_stmt_log_lock)
+ {
+ pthread_mutex_unlock(&table_share->mutex);
+ auto_increment_lock= FALSE;
+ }
+ }
+ virtual void set_auto_increment_if_higher(const ulonglong nr)
+ {
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ lock_auto_increment();
+ DBUG_ASSERT(ha_data->auto_inc_initialized == TRUE);
+ /* must check when the mutex is taken */
+ if (nr >= ha_data->next_auto_inc_val)
+ ha_data->next_auto_inc_val= nr + 1;
+ unlock_auto_increment();
+ }
+
+public:
/*
-------------------------------------------------------------------------
- MODULE initialise handler for HANDLER call
+ MODULE initialize handler for HANDLER call
-------------------------------------------------------------------------
This method is a special InnoDB method called before a HANDLER query.
-------------------------------------------------------------------------
@@ -898,13 +1003,14 @@ public:
-------------------------------------------------------------------------
MODULE on-line ALTER TABLE
-------------------------------------------------------------------------
- These methods are in the handler interface but never used (yet)
- They are to be used by on-line alter table add/drop index:
+ These methods are in the handler interface. (used by innodb-plugin)
+ They are used for on-line/fast alter table add/drop index:
-------------------------------------------------------------------------
- virtual ulong index_ddl_flags(KEY *wanted_index) const
- virtual int add_index(TABLE *table_arg,KEY *key_info,uint num_of_keys);
- virtual int drop_index(TABLE *table_arg,uint *key_num,uint num_of_keys);
*/
+ virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
+ virtual int prepare_drop_index(TABLE *table_arg, uint *key_num,
+ uint num_of_keys);
+ virtual int final_drop_index(TABLE *table_arg);
/*
-------------------------------------------------------------------------
@@ -937,8 +1043,7 @@ public:
virtual bool is_crashed() const;
private:
- int handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
- uint flags, bool all_parts);
+ int handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, uint flags);
public:
/*
-------------------------------------------------------------------------
diff --git a/sql/handler.cc b/sql/handler.cc
index 733e77b6397..cbb951cd450 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -263,7 +263,7 @@ handler *get_ha_partition(partition_info *part_info)
DBUG_ENTER("get_ha_partition");
if ((partition= new ha_partition(partition_hton, part_info)))
{
- if (partition->initialise_partition(current_thd->mem_root))
+ if (partition->initialize_partition(current_thd->mem_root))
{
delete partition;
partition= 0;
@@ -373,7 +373,12 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
handlerton *hton= (handlerton *)plugin->data;
DBUG_ENTER("ha_finalize_handlerton");
- switch (hton->state) {
+ /* hton can be NULL here, if ha_initialize_handlerton() failed. */
+ if (!hton)
+ goto end;
+
+ switch (hton->state)
+ {
case SHOW_OPTION_NO:
case SHOW_OPTION_DISABLED:
break;
@@ -400,8 +405,16 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
}
}
+ /*
+ In case a plugin is uninstalled and re-installed later, it should
+ reuse an array slot. Otherwise the number of uninstall/install
+ cycles would be limited.
+ */
+ hton2plugin[hton->slot]= NULL;
+
my_free((uchar*)hton, MYF(0));
+ end:
DBUG_RETURN(0);
}
@@ -436,6 +449,7 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
case SHOW_OPTION_YES:
{
uint tmp;
+ ulong fslot;
/* now check the db_type for conflict */
if (hton->db_type <= DB_TYPE_UNKNOWN ||
hton->db_type >= DB_TYPE_DEFAULT ||
@@ -460,7 +474,31 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
tmp= hton->savepoint_offset;
hton->savepoint_offset= savepoint_alloc_size;
savepoint_alloc_size+= tmp;
- hton->slot= total_ha++;
+
+ /*
+ In case a plugin is uninstalled and re-installed later, it should
+ reuse an array slot. Otherwise the number of uninstall/install
+ cycles would be limited. So look for a free slot.
+ */
+ DBUG_PRINT("plugin", ("total_ha: %lu", total_ha));
+ for (fslot= 0; fslot < total_ha; fslot++)
+ {
+ if (!hton2plugin[fslot])
+ break;
+ }
+ if (fslot < total_ha)
+ hton->slot= fslot;
+ else
+ {
+ if (total_ha >= MAX_HA)
+ {
+ sql_print_error("Too many plugins loaded. Limit is %lu. "
+ "Failed on '%s'", (ulong) MAX_HA, plugin->name.str);
+ goto err;
+ }
+ hton->slot= total_ha++;
+ }
+
hton2plugin[hton->slot]=plugin;
if (hton->prepare)
total_ha_2pc++;
@@ -1240,7 +1278,12 @@ int ha_rollback_trans(THD *thd, bool all)
trans->ha_list= 0;
trans->no_2pc=0;
if (is_real_trans)
- thd->transaction.xid_state.xid.null();
+ {
+ if (thd->transaction_rollback_request)
+ thd->transaction.xid_state.rm_error= thd->main_da.sql_errno();
+ else
+ thd->transaction.xid_state.xid.null();
+ }
if (all)
{
thd->variables.tx_isolation=thd->session_tx_isolation;
@@ -2164,7 +2207,12 @@ prev_insert_id(ulonglong nr, struct system_variables *variables)
- In both cases, the reserved intervals are remembered in
thd->auto_inc_intervals_in_cur_stmt_for_binlog if statement-based
binlogging; the last reserved interval is remembered in
- auto_inc_interval_for_cur_row.
+ auto_inc_interval_for_cur_row. The number of reserved intervals is
+ remembered in auto_inc_intervals_count. It differs from the number of
+ elements in thd->auto_inc_intervals_in_cur_stmt_for_binlog() because the
+ latter list is cumulative over all statements forming one binlog event
+ (when stored functions and triggers are used), and collapses two
+ contiguous intervals in one (see its append() method).
The idea is that generated auto_increment values are predictable and
independent of the column values in the table. This is needed to be
@@ -2248,8 +2296,6 @@ int handler::update_auto_increment()
handler::estimation_rows_to_insert was set by
handler::ha_start_bulk_insert(); if 0 it means "unknown".
*/
- uint nb_already_reserved_intervals=
- thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements();
ulonglong nb_desired_values;
/*
If an estimation was given to the engine:
@@ -2261,17 +2307,17 @@ int handler::update_auto_increment()
start, starting from AUTO_INC_DEFAULT_NB_ROWS.
Don't go beyond a max to not reserve "way too much" (because
reservation means potentially losing unused values).
+ Note that in prelocked mode no estimation is given.
*/
- if (nb_already_reserved_intervals == 0 &&
- (estimation_rows_to_insert > 0))
+ if ((auto_inc_intervals_count == 0) && (estimation_rows_to_insert > 0))
nb_desired_values= estimation_rows_to_insert;
else /* go with the increasing defaults */
{
/* avoid overflow in formula, with this if() */
- if (nb_already_reserved_intervals <= AUTO_INC_DEFAULT_NB_MAX_BITS)
+ if (auto_inc_intervals_count <= AUTO_INC_DEFAULT_NB_MAX_BITS)
{
- nb_desired_values= AUTO_INC_DEFAULT_NB_ROWS *
- (1 << nb_already_reserved_intervals);
+ nb_desired_values= AUTO_INC_DEFAULT_NB_ROWS *
+ (1 << auto_inc_intervals_count);
set_if_smaller(nb_desired_values, AUTO_INC_DEFAULT_NB_MAX);
}
else
@@ -2284,7 +2330,7 @@ int handler::update_auto_increment()
&nb_reserved_values);
if (nr == ~(ulonglong) 0)
DBUG_RETURN(HA_ERR_AUTOINC_READ_FAILED); // Mark failure
-
+
/*
That rounding below should not be needed when all engines actually
respect offset and increment in get_auto_increment(). But they don't
@@ -2295,7 +2341,7 @@ int handler::update_auto_increment()
*/
nr= compute_next_insert_id(nr-1, variables);
}
-
+
if (table->s->next_number_keypart == 0)
{
/* We must defer the appending until "nr" has been possibly truncated */
@@ -2339,8 +2385,9 @@ int handler::update_auto_increment()
{
auto_inc_interval_for_cur_row.replace(nr, nb_reserved_values,
variables->auto_increment_increment);
+ auto_inc_intervals_count++;
/* Row-based replication does not need to store intervals in binlog */
- if (!thd->current_stmt_binlog_row_based)
+ if (mysql_bin_log.is_open() && !thd->current_stmt_binlog_row_based)
thd->auto_inc_intervals_in_cur_stmt_for_binlog.append(auto_inc_interval_for_cur_row.minimum(),
auto_inc_interval_for_cur_row.values(),
variables->auto_increment_increment);
@@ -2460,6 +2507,7 @@ void handler::ha_release_auto_increment()
release_auto_increment();
insert_id_for_cur_row= 0;
auto_inc_interval_for_cur_row.replace(0, 0, 0);
+ auto_inc_intervals_count= 0;
if (next_insert_id > 0)
{
next_insert_id= 0;
@@ -2712,8 +2760,56 @@ bool handler::get_error_message(int error, String* buf)
}
+/**
+ Check for incompatible collation changes.
+
+ @retval
+ HA_ADMIN_NEEDS_UPGRADE Table may have data requiring upgrade.
+ @retval
+ 0 No upgrade required.
+*/
+
+int handler::check_collation_compatibility()
+{
+ ulong mysql_version= table->s->mysql_version;
+
+ if (mysql_version < 50124)
+ {
+ KEY *key= table->key_info;
+ KEY *key_end= key + table->s->keys;
+ for (; key < key_end; key++)
+ {
+ KEY_PART_INFO *key_part= key->key_part;
+ KEY_PART_INFO *key_part_end= key_part + key->key_parts;
+ for (; key_part < key_part_end; key_part++)
+ {
+ if (!key_part->fieldnr)
+ continue;
+ Field *field= table->field[key_part->fieldnr - 1];
+ uint cs_number= field->charset()->number;
+ if ((mysql_version < 50048 &&
+ (cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */
+ cs_number == 41 || /* latin7_general_ci - bug #29461 */
+ cs_number == 42 || /* latin7_general_cs - bug #29461 */
+ cs_number == 20 || /* latin7_estonian_cs - bug #29461 */
+ cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */
+ cs_number == 22 || /* koi8u_general_ci - bug #29461 */
+ cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */
+ cs_number == 26)) || /* cp1250_general_ci - bug #29461 */
+ (mysql_version < 50124 &&
+ (cs_number == 33 || /* utf8_general_ci - bug #27877 */
+ cs_number == 35))) /* ucs2_general_ci - bug #27877 */
+ return HA_ADMIN_NEEDS_UPGRADE;
+ }
+ }
+ }
+ return 0;
+}
+
+
int handler::ha_check_for_upgrade(HA_CHECK_OPT *check_opt)
{
+ int error;
KEY *keyinfo, *keyend;
KEY_PART_INFO *keypart, *keypartend;
@@ -2742,6 +2838,10 @@ int handler::ha_check_for_upgrade(HA_CHECK_OPT *check_opt)
}
if (table->s->frm_version != FRM_VER_TRUE_VARCHAR)
return HA_ADMIN_NEEDS_ALTER;
+
+ if ((error= check_collation_compatibility()))
+ return error;
+
return check_for_upgrade(check_opt);
}
@@ -3244,8 +3344,8 @@ handler::ha_create_handler_files(const char *name, const char *old_name,
int
handler::ha_change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_frm_len)
{
@@ -4334,6 +4434,8 @@ static int write_locked_table_maps(THD *thd)
(long) thd, (long) thd->lock,
(long) thd->locked_tables, (long) thd->extra_lock));
+ DBUG_PRINT("debug", ("get_binlog_table_maps(): %d", thd->get_binlog_table_maps()));
+
if (thd->get_binlog_table_maps() == 0)
{
MYSQL_LOCK *locks[3];
diff --git a/sql/handler.h b/sql/handler.h
index f6e29048407..68bb894a5d2 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1136,6 +1136,13 @@ public:
inserter.
*/
Discrete_interval auto_inc_interval_for_cur_row;
+ /**
+ Number of reserved auto-increment intervals. Serves as a heuristic
+ when we have no estimation of how many records the statement will insert:
+ the more intervals we have reserved, the bigger the next one. Reset in
+ handler::ha_release_auto_increment().
+ */
+ uint auto_inc_intervals_count;
handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
:table_share(share_arg), table(0),
@@ -1144,7 +1151,8 @@ public:
ref_length(sizeof(my_off_t)),
ft_handler(0), inited(NONE),
locked(FALSE), implicit_emptied(0),
- pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0)
+ pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0),
+ auto_inc_intervals_count(0)
{}
virtual ~handler(void)
{
@@ -1197,6 +1205,9 @@ public:
{
return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0;
}
+ /**
+ The cached_table_flags is set at ha_open and ha_external_lock
+ */
Table_flags ha_table_flags() const { return cached_table_flags; }
/**
These functions represent the public interface to *users* of the
@@ -1210,6 +1221,7 @@ public:
int ha_delete_row(const uchar * buf);
void ha_release_auto_increment();
+ int check_collation_compatibility();
int ha_check_for_upgrade(HA_CHECK_OPT *check_opt);
/** to be actually called to get 'check()' functionality*/
int ha_check(THD *thd, HA_CHECK_OPT *check_opt);
@@ -1248,8 +1260,8 @@ public:
int ha_change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_frm_len);
int ha_drop_partitions(const char *path);
@@ -1734,6 +1746,12 @@ public:
but we don't have a primary key
*/
virtual void use_hidden_primary_key();
+ virtual uint alter_table_flags(uint flags)
+ {
+ if (ht->alter_table_flags)
+ return ht->alter_table_flags(flags);
+ return 0;
+ }
LEX_STRING *engine_name() { return hton_name(ht); }
@@ -1872,7 +1890,8 @@ private:
This is called to delete all rows in a table
If the handler don't support this, then this function will
return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one
- by one.
+ by one. It should reset auto_increment if
+ thd->lex->sql_command == SQLCOM_TRUNCATE.
*/
virtual int delete_all_rows()
{ return (my_errno=HA_ERR_WRONG_COMMAND); }
@@ -1911,8 +1930,8 @@ private:
virtual int change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_frm_len)
{ return HA_ERR_WRONG_COMMAND; }
diff --git a/sql/item.cc b/sql/item.cc
index d443b9d87c6..d630ca7bc60 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1246,10 +1246,12 @@ Item_name_const::Item_name_const(Item *name_arg, Item *val):
if (!(valid_args= name_item->basic_const_item() &&
(value_item->basic_const_item() ||
((value_item->type() == FUNC_ITEM) &&
- (((Item_func *) value_item)->functype() ==
- Item_func::NEG_FUNC) &&
+ ((((Item_func *) value_item)->functype() ==
+ Item_func::COLLATE_FUNC) ||
+ ((((Item_func *) value_item)->functype() ==
+ Item_func::NEG_FUNC) &&
(((Item_func *) value_item)->key_item()->type() !=
- FUNC_ITEM)))))
+ FUNC_ITEM)))))))
my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST");
Item::maybe_null= TRUE;
}
@@ -1334,6 +1336,7 @@ public:
else
Item_ident::print(str, query_type);
}
+ virtual Ref_Type ref_type() { return AGGREGATE_REF; }
};
@@ -1797,14 +1800,17 @@ Item_field::Item_field(THD *thd, Name_resolution_context *context_arg,
We need to copy db_name, table_name and field_name because they must
be allocated in the statement memory, not in table memory (the table
structure can go away and pop up again between subsequent executions
- of a prepared statement).
+ of a prepared statement or after the close_tables_for_reopen() call
+ in mysql_multi_update_prepare() or due to wildcard expansion in stored
+ procedures).
*/
- if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
{
if (db_name)
orig_db_name= thd->strdup(db_name);
- orig_table_name= thd->strdup(table_name);
- orig_field_name= thd->strdup(field_name);
+ if (table_name)
+ orig_table_name= thd->strdup(table_name);
+ if (field_name)
+ orig_field_name= thd->strdup(field_name);
/*
We don't restore 'name' in cleanup because it's not changed
during execution. Still we need it to point to persistent
@@ -2376,17 +2382,15 @@ void Item_string::print(String *str, enum_query_type query_type)
}
-double Item_string::val_real()
+double
+double_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end)
{
- DBUG_ASSERT(fixed == 1);
int error;
- char *end, *org_end;
+ char *org_end;
double tmp;
- CHARSET_INFO *cs= str_value.charset();
- org_end= (char*) str_value.ptr() + str_value.length();
- tmp= my_strntod(cs, (char*) str_value.ptr(), str_value.length(), &end,
- &error);
+ org_end= end;
+ tmp= my_strntod(cs, (char*) cptr, end - cptr, &end, &error);
if (error || (end != org_end && !check_if_only_end_space(cs, end, org_end)))
{
/*
@@ -2396,26 +2400,28 @@ double Item_string::val_real()
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "DOUBLE",
- str_value.ptr());
+ cptr);
}
return tmp;
}
-/**
- @todo
- Give error if we wanted a signed integer and we got an unsigned one
-*/
-longlong Item_string::val_int()
+double Item_string::val_real()
{
DBUG_ASSERT(fixed == 1);
+ return double_from_string_with_check (str_value.charset(), str_value.ptr(),
+ (char *) str_value.ptr() + str_value.length());
+}
+
+
+longlong
+longlong_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end)
+{
int err;
longlong tmp;
- char *end= (char*) str_value.ptr()+ str_value.length();
char *org_end= end;
- CHARSET_INFO *cs= str_value.charset();
- tmp= (*(cs->cset->strtoll10))(cs, str_value.ptr(), &end, &err);
+ tmp= (*(cs->cset->strtoll10))(cs, cptr, &end, &err);
/*
TODO: Give error if we wanted a signed integer and we got an unsigned
one
@@ -2426,12 +2432,24 @@ longlong Item_string::val_int()
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
- str_value.ptr());
+ cptr);
}
return tmp;
}
+/**
+ @todo
+ Give error if we wanted a signed integer and we got an unsigned one
+*/
+longlong Item_string::val_int()
+{
+ DBUG_ASSERT(fixed == 1);
+ return longlong_from_string_with_check(str_value.charset(), str_value.ptr(),
+ (char *) str_value.ptr()+ str_value.length());
+}
+
+
my_decimal *Item_string::val_decimal(my_decimal *decimal_value)
{
return val_decimal_from_string(decimal_value);
@@ -4338,7 +4356,12 @@ Item *Item_field::equal_fields_propagator(uchar *arg)
item= this;
else if (field && (field->flags & ZEROFILL_FLAG) && IS_NUM(field->type()))
{
- if (item && cmp_context != INT_RESULT)
+ /*
+ We don't need to zero-fill timestamp columns here because they will be
+ first converted to a string (in date/time format) and compared as such if
+ compared with another string.
+ */
+ if (item && field->type() != FIELD_TYPE_TIMESTAMP && cmp_context != INT_RESULT)
convert_zerofill_number_to_string(&item, (Field_num *)field);
else
item= this;
@@ -6928,7 +6951,7 @@ enum_field_types Item_type_holder::get_real_type(Item *item)
*/
Item_sum *item_sum= (Item_sum *) item;
if (item_sum->keep_field_type())
- return get_real_type(item_sum->args[0]);
+ return get_real_type(item_sum->get_arg(0));
break;
}
case FUNC_ITEM:
@@ -7192,7 +7215,7 @@ void Item_type_holder::get_full_info(Item *item)
if (item->type() == Item::SUM_FUNC_ITEM &&
(((Item_sum*)item)->sum_func() == Item_sum::MAX_FUNC ||
((Item_sum*)item)->sum_func() == Item_sum::MIN_FUNC))
- item = ((Item_sum*)item)->args[0];
+ item = ((Item_sum*)item)->get_arg(0);
/*
We can have enum/set type after merging only if we have one enum|set
field (or MIN|MAX(enum|set field)) and number of NULL fields
diff --git a/sql/item.h b/sql/item.h
index 97350352162..c46a3322d94 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1982,6 +1982,11 @@ private:
};
+longlong
+longlong_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end);
+double
+double_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end);
+
class Item_static_string_func :public Item_string
{
const char *func_name;
@@ -2127,7 +2132,7 @@ class Item_ref :public Item_ident
protected:
void set_properties();
public:
- enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF };
+ enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF, AGGREGATE_REF };
Field *result_field; /* Save result here */
Item **ref;
Item_ref(Name_resolution_context *context_arg,
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index a79a94868c8..5fe324f1b6a 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -413,10 +413,15 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
/*
- Store the value of the field if it references an outer field because
- the call to save_in_field below overrides that value.
+ Store the value of the field/constant if it references an outer field
+ because the call to save_in_field below overrides that value.
+ Don't save field value if no data has been read yet.
+ Outer constant values are always saved.
*/
- if (field_item->depended_from)
+ bool save_field_value= (field_item->depended_from &&
+ (field_item->const_item() ||
+ !(field->table->status & STATUS_NO_RECORD)));
+ if (save_field_value)
orig_field_val= field->val_int();
if (!(*item)->is_null() && !(*item)->save_in_field(field, 1))
{
@@ -427,7 +432,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
result= 1; // Item was replaced
}
/* Restore the original field value. */
- if (field_item->depended_from)
+ if (save_field_value)
{
result= field->store(orig_field_val, TRUE);
/* orig_field_val must be a valid value that can be restored back. */
diff --git a/sql/item_func.cc b/sql/item_func.cc
index b3c50718273..87d15c7968d 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3803,6 +3803,25 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
return entry;
}
+
+bool Item_func_set_user_var::set_entry(THD *thd, bool create_if_not_exists)
+{
+ if (thd == entry_thd && entry)
+ goto end; // update entry->update_query_id for PS
+ entry_thd= thd;
+ if (!(entry= get_variable(&thd->user_vars, name, create_if_not_exists)))
+ return TRUE;
+ /*
+ Remember the last query which updated it, this way a query can later know
+ if this variable is a constant item in the query (it is if update_query_id
+ is different from query_id).
+ */
+end:
+ entry->update_query_id= thd->query_id;
+ return FALSE;
+}
+
+
/*
When a user variable is updated (in a SET command or a query like
SELECT @a:= ).
@@ -3812,15 +3831,8 @@ bool Item_func_set_user_var::fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed == 0);
/* fix_fields will call Item_func_set_user_var::fix_length_and_dec */
- if (Item_func::fix_fields(thd, ref) ||
- !(entry= get_variable(&thd->user_vars, name, 1)))
+ if (Item_func::fix_fields(thd, ref) || set_entry(thd, TRUE))
return TRUE;
- /*
- Remember the last query which updated it, this way a query can later know
- if this variable is a constant item in the query (it is if update_query_id
- is different from query_id).
- */
- entry->update_query_id= thd->query_id;
/*
As it is wrong and confusing to associate any
character set with NULL, @a should be latin2
@@ -4791,36 +4803,398 @@ Item_func_get_system_var::
Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
LEX_STRING *component_arg, const char *name_arg,
size_t name_len_arg)
- :var(var_arg), var_type(var_type_arg), component(*component_arg)
+ :var(var_arg), var_type(var_type_arg), orig_var_type(var_type_arg),
+ component(*component_arg), cache_present(0)
{
/* set_name() will allocate the name */
set_name(name_arg, name_len_arg, system_charset_info);
}
-bool
-Item_func_get_system_var::fix_fields(THD *thd, Item **ref)
+bool Item_func_get_system_var::is_written_to_binlog()
{
- Item *item;
- DBUG_ENTER("Item_func_get_system_var::fix_fields");
+ return var->is_written_to_binlog(var_type);
+}
- /*
- Evaluate the system variable and substitute the result (a basic constant)
- instead of this item. If the variable can not be evaluated,
- the error is reported in sys_var::item().
- */
- if (!(item= var->item(thd, var_type, &component)))
- DBUG_RETURN(1); // Impossible
- item->set_name(name, 0, system_charset_info); // don't allocate a new name
- thd->change_item_tree(ref, item);
- DBUG_RETURN(0);
+void Item_func_get_system_var::fix_length_and_dec()
+{
+ maybe_null=0;
+
+ if (var->check_type(var_type))
+ {
+ if (var_type != OPT_DEFAULT)
+ {
+ my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0),
+ var->name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL");
+ return;
+ }
+ /* As there was no local variable, return the global value */
+ var_type= OPT_GLOBAL;
+ }
+
+ switch (var->show_type())
+ {
+ case SHOW_LONG:
+ case SHOW_INT:
+ case SHOW_HA_ROWS:
+ unsigned_flag= TRUE;
+ max_length= MY_INT64_NUM_DECIMAL_DIGITS;
+ decimals=0;
+ break;
+ case SHOW_LONGLONG:
+ unsigned_flag= FALSE;
+ max_length= MY_INT64_NUM_DECIMAL_DIGITS;
+ decimals=0;
+ break;
+ case SHOW_CHAR:
+ case SHOW_CHAR_PTR:
+ collation.set(system_charset_info, DERIVATION_SYSCONST);
+ max_length= MAX_BLOB_WIDTH;
+ decimals=NOT_FIXED_DEC;
+ break;
+ case SHOW_MY_BOOL:
+ unsigned_flag= FALSE;
+ max_length= 1;
+ decimals=0;
+ break;
+ case SHOW_DOUBLE:
+ unsigned_flag= FALSE;
+ decimals= 6;
+ max_length= DBL_DIG + 6;
+ break;
+ default:
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ break;
+ }
}
-bool Item_func_get_system_var::is_written_to_binlog()
+void Item_func_get_system_var::print(String *str, enum_query_type query_type)
{
- return var->is_written_to_binlog(var_type);
+ str->append(name, name_length);
+}
+
+
+enum Item_result Item_func_get_system_var::result_type() const
+{
+ switch (var->show_type())
+ {
+ case SHOW_MY_BOOL:
+ case SHOW_INT:
+ case SHOW_LONG:
+ case SHOW_LONGLONG:
+ case SHOW_HA_ROWS:
+ return INT_RESULT;
+ case SHOW_CHAR:
+ case SHOW_CHAR_PTR:
+ return STRING_RESULT;
+ case SHOW_DOUBLE:
+ return REAL_RESULT;
+ default:
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ return STRING_RESULT; // keep the compiler happy
+ }
+}
+
+
+enum_field_types Item_func_get_system_var::field_type() const
+{
+ switch (var->show_type())
+ {
+ case SHOW_MY_BOOL:
+ case SHOW_INT:
+ case SHOW_LONG:
+ case SHOW_LONGLONG:
+ case SHOW_HA_ROWS:
+ return MYSQL_TYPE_LONGLONG;
+ case SHOW_CHAR:
+ case SHOW_CHAR_PTR:
+ return MYSQL_TYPE_VARCHAR;
+ case SHOW_DOUBLE:
+ return MYSQL_TYPE_DOUBLE;
+ default:
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ return MYSQL_TYPE_VARCHAR; // keep the compiler happy
+ }
+}
+
+
+#define get_sys_var_safe(type) \
+do { \
+ type value; \
+ pthread_mutex_lock(&LOCK_global_system_variables); \
+ value= *(type*) var->value_ptr(thd, var_type, &component); \
+ pthread_mutex_unlock(&LOCK_global_system_variables); \
+ cache_present |= GET_SYS_VAR_CACHE_LONG; \
+ used_query_id= thd->query_id; \
+ cached_llval= null_value ? 0 : (longlong) value; \
+ cached_null_value= null_value; \
+ return cached_llval; \
+} while (0)
+
+
+longlong Item_func_get_system_var::val_int()
+{
+ THD *thd= current_thd;
+
+ if (cache_present && thd->query_id == used_query_id)
+ {
+ if (cache_present & GET_SYS_VAR_CACHE_LONG)
+ {
+ null_value= cached_null_value;
+ return cached_llval;
+ }
+ else if (cache_present & GET_SYS_VAR_CACHE_DOUBLE)
+ {
+ null_value= cached_null_value;
+ cached_llval= (longlong) cached_dval;
+ cache_present|= GET_SYS_VAR_CACHE_LONG;
+ return cached_llval;
+ }
+ else if (cache_present & GET_SYS_VAR_CACHE_STRING)
+ {
+ null_value= cached_null_value;
+ if (!null_value)
+ cached_llval= longlong_from_string_with_check (cached_strval.charset(),
+ cached_strval.c_ptr(),
+ cached_strval.c_ptr() +
+ cached_strval.length());
+ else
+ cached_llval= 0;
+ cache_present|= GET_SYS_VAR_CACHE_LONG;
+ return cached_llval;
+ }
+ }
+
+ switch (var->show_type())
+ {
+ case SHOW_INT: get_sys_var_safe (uint);
+ case SHOW_LONG: get_sys_var_safe (ulong);
+ case SHOW_LONGLONG: get_sys_var_safe (longlong);
+ case SHOW_HA_ROWS: get_sys_var_safe (ha_rows);
+ case SHOW_MY_BOOL: get_sys_var_safe (my_bool);
+ case SHOW_DOUBLE:
+ {
+ double dval= val_real();
+
+ used_query_id= thd->query_id;
+ cached_llval= (longlong) dval;
+ cache_present|= GET_SYS_VAR_CACHE_LONG;
+ return cached_llval;
+ }
+ case SHOW_CHAR:
+ case SHOW_CHAR_PTR:
+ {
+ String *str_val= val_str(NULL);
+
+ if (str_val && str_val->length())
+ cached_llval= longlong_from_string_with_check (system_charset_info,
+ str_val->c_ptr(),
+ str_val->c_ptr() +
+ str_val->length());
+ else
+ {
+ null_value= TRUE;
+ cached_llval= 0;
+ }
+
+ cache_present|= GET_SYS_VAR_CACHE_LONG;
+ return cached_llval;
+ }
+
+ default:
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ return 0; // keep the compiler happy
+ }
+}
+
+
+String* Item_func_get_system_var::val_str(String* str)
+{
+ THD *thd= current_thd;
+
+ if (cache_present && thd->query_id == used_query_id)
+ {
+ if (cache_present & GET_SYS_VAR_CACHE_STRING)
+ {
+ null_value= cached_null_value;
+ return null_value ? NULL : &cached_strval;
+ }
+ else if (cache_present & GET_SYS_VAR_CACHE_LONG)
+ {
+ null_value= cached_null_value;
+ if (!null_value)
+ cached_strval.set (cached_llval, collation.collation);
+ cache_present|= GET_SYS_VAR_CACHE_STRING;
+ return null_value ? NULL : &cached_strval;
+ }
+ else if (cache_present & GET_SYS_VAR_CACHE_DOUBLE)
+ {
+ null_value= cached_null_value;
+ if (!null_value)
+ cached_strval.set_real (cached_dval, decimals, collation.collation);
+ cache_present|= GET_SYS_VAR_CACHE_STRING;
+ return null_value ? NULL : &cached_strval;
+ }
+ }
+
+ str= &cached_strval;
+ switch (var->show_type())
+ {
+ case SHOW_CHAR:
+ case SHOW_CHAR_PTR:
+ {
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ char *cptr= var->show_type() == SHOW_CHAR_PTR ?
+ *(char**) var->value_ptr(thd, var_type, &component) :
+ (char*) var->value_ptr(thd, var_type, &component);
+ if (cptr)
+ {
+ if (str->copy(cptr, strlen(cptr), collation.collation))
+ {
+ null_value= TRUE;
+ str= NULL;
+ }
+ }
+ else
+ {
+ null_value= TRUE;
+ str= NULL;
+ }
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ break;
+ }
+
+ case SHOW_INT:
+ case SHOW_LONG:
+ case SHOW_LONGLONG:
+ case SHOW_HA_ROWS:
+ case SHOW_MY_BOOL:
+ str->set (val_int(), collation.collation);
+ break;
+ case SHOW_DOUBLE:
+ str->set_real (val_real(), decimals, collation.collation);
+ break;
+
+ default:
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ str= NULL;
+ break;
+ }
+
+ cache_present|= GET_SYS_VAR_CACHE_STRING;
+ used_query_id= thd->query_id;
+ cached_null_value= null_value;
+ return str;
+}
+
+
+double Item_func_get_system_var::val_real()
+{
+ THD *thd= current_thd;
+
+ if (cache_present && thd->query_id == used_query_id)
+ {
+ if (cache_present & GET_SYS_VAR_CACHE_DOUBLE)
+ {
+ null_value= cached_null_value;
+ return cached_dval;
+ }
+ else if (cache_present & GET_SYS_VAR_CACHE_LONG)
+ {
+ null_value= cached_null_value;
+ cached_dval= (double)cached_llval;
+ cache_present|= GET_SYS_VAR_CACHE_DOUBLE;
+ return cached_dval;
+ }
+ else if (cache_present & GET_SYS_VAR_CACHE_STRING)
+ {
+ null_value= cached_null_value;
+ if (!null_value)
+ cached_dval= double_from_string_with_check (cached_strval.charset(),
+ cached_strval.c_ptr(),
+ cached_strval.c_ptr() +
+ cached_strval.length());
+ else
+ cached_dval= 0;
+ cache_present|= GET_SYS_VAR_CACHE_DOUBLE;
+ return cached_dval;
+ }
+ }
+
+ switch (var->show_type())
+ {
+ case SHOW_DOUBLE:
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ cached_dval= *(double*) var->value_ptr(thd, var_type, &component);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ used_query_id= thd->query_id;
+ cached_null_value= null_value;
+ if (null_value)
+ cached_dval= 0;
+ cache_present|= GET_SYS_VAR_CACHE_DOUBLE;
+ return cached_dval;
+ case SHOW_CHAR:
+ case SHOW_CHAR_PTR:
+ {
+ char *cptr;
+
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ cptr= var->show_type() == SHOW_CHAR ?
+ (char*) var->value_ptr(thd, var_type, &component) :
+ *(char**) var->value_ptr(thd, var_type, &component);
+ if (cptr)
+ cached_dval= double_from_string_with_check (system_charset_info,
+ cptr, cptr + strlen (cptr));
+ else
+ {
+ null_value= TRUE;
+ cached_dval= 0;
+ }
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ used_query_id= thd->query_id;
+ cached_null_value= null_value;
+ cache_present|= GET_SYS_VAR_CACHE_DOUBLE;
+ return cached_dval;
+ }
+ case SHOW_INT:
+ case SHOW_LONG:
+ case SHOW_LONGLONG:
+ case SHOW_HA_ROWS:
+ case SHOW_MY_BOOL:
+ cached_dval= (double) val_int();
+ cache_present|= GET_SYS_VAR_CACHE_DOUBLE;
+ used_query_id= thd->query_id;
+ cached_null_value= null_value;
+ return cached_dval;
+ default:
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ return 0;
+ }
+}
+
+
+bool Item_func_get_system_var::eq(const Item *item, bool binary_cmp) const
+{
+ /* Assume we don't have rtti */
+ if (this == item)
+ return 1; // Same item is same.
+ /* Check if other type is also a get_user_var() object */
+ if (item->type() != FUNC_ITEM ||
+ ((Item_func*) item)->functype() != functype())
+ return 0;
+ Item_func_get_system_var *other=(Item_func_get_system_var*) item;
+ return (var == other->var && var_type == other->var_type);
+}
+
+
+void Item_func_get_system_var::cleanup()
+{
+ Item_func::cleanup();
+ cache_present= 0;
+ var_type= orig_var_type;
+ cached_strval.free();
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 80d4f58ad8a..5f791f495b9 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -55,7 +55,7 @@ public:
NOW_FUNC, TRIG_COND_FUNC,
SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC,
EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC,
- NEG_FUNC };
+ NEG_FUNC, GSYSVAR_FUNC };
enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL,
OPTIMIZE_EQUAL };
enum Type type() const { return FUNC_ITEM; }
@@ -1294,6 +1294,17 @@ class Item_func_set_user_var :public Item_func
{
enum Item_result cached_result_type;
user_var_entry *entry;
+ /*
+ The entry_thd variable is used:
+ 1) to skip unnecessary updates of the entry field (see above);
+ 2) to reset the entry field that was initialized in the other thread
+ (for example, an item tree of a trigger that updates user variables
+ may be shared between several connections, and the entry_thd field
+ prevents updates of one connection user variables from a concurrent
+ connection calling the same trigger that initially updated some
+ user variable it the first connection context).
+ */
+ THD *entry_thd;
char buffer[MAX_FIELD_WIDTH];
String value;
my_decimal decimal_buff;
@@ -1309,7 +1320,8 @@ class Item_func_set_user_var :public Item_func
public:
LEX_STRING name; // keep it public
Item_func_set_user_var(LEX_STRING a,Item *b)
- :Item_func(b), cached_result_type(INT_RESULT), name(a)
+ :Item_func(b), cached_result_type(INT_RESULT),
+ entry(NULL), entry_thd(NULL), name(a)
{}
enum Functype functype() const { return SUSERVAR_FUNC; }
double val_real();
@@ -1340,6 +1352,7 @@ public:
}
void save_org_in_field(Field *field) { (void)save_in_field(field, 1, 0); }
bool register_field_in_read_map(uchar *arg);
+ bool set_entry(THD *thd, bool create_if_not_exists);
};
@@ -1413,24 +1426,36 @@ public:
/* A system variable */
+#define GET_SYS_VAR_CACHE_LONG 1
+#define GET_SYS_VAR_CACHE_DOUBLE 2
+#define GET_SYS_VAR_CACHE_STRING 4
+
class Item_func_get_system_var :public Item_func
{
sys_var *var;
- enum_var_type var_type;
+ enum_var_type var_type, orig_var_type;
LEX_STRING component;
+ longlong cached_llval;
+ double cached_dval;
+ String cached_strval;
+ my_bool cached_null_value;
+ query_id_t used_query_id;
+ uchar cache_present;
+
public:
Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
LEX_STRING *component_arg, const char *name_arg,
size_t name_len_arg);
- bool fix_fields(THD *thd, Item **ref);
- /*
- Stubs for pure virtual methods. Should never be called: this
- item is always substituted with a constant in fix_fields().
- */
- double val_real() { DBUG_ASSERT(0); return 0.0; }
- longlong val_int() { DBUG_ASSERT(0); return 0; }
- String* val_str(String*) { DBUG_ASSERT(0); return 0; }
- void fix_length_and_dec() { DBUG_ASSERT(0); }
+ enum Functype functype() const { return GSYSVAR_FUNC; }
+ void fix_length_and_dec();
+ void print(String *str, enum_query_type query_type);
+ bool const_item() const { return true; }
+ table_map used_tables() const { return 0; }
+ enum Item_result result_type() const;
+ enum_field_types field_type() const;
+ double val_real();
+ longlong val_int();
+ String* val_str(String*);
/* TODO: fix to support views */
const char *func_name() const { return "get_system_var"; }
/**
@@ -1442,6 +1467,9 @@ public:
@return true if the variable is written to the binlog, false otherwise.
*/
bool is_written_to_binlog();
+ bool eq(const Item *item, bool binary_cmp) const;
+
+ void cleanup();
};
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 96f0b6a142d..c2b3b954634 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -369,6 +369,10 @@ Item_sum::Item_sum(List<Item> &list) :arg_count(list.elements),
args[i++]= item;
}
}
+ if (!(orig_args= (Item **) sql_alloc(sizeof(Item *) * arg_count)))
+ {
+ args= NULL;
+ }
mark_as_sum_func();
list.empty(); // Fields are used
}
@@ -379,18 +383,28 @@ Item_sum::Item_sum(List<Item> &list) :arg_count(list.elements),
*/
Item_sum::Item_sum(THD *thd, Item_sum *item):
- Item_result_field(thd, item), arg_count(item->arg_count),
+ Item_result_field(thd, item),
aggr_sel(item->aggr_sel),
nest_level(item->nest_level), aggr_level(item->aggr_level),
- quick_group(item->quick_group), used_tables_cache(item->used_tables_cache),
+ quick_group(item->quick_group),
+ arg_count(item->arg_count), orig_args(NULL),
+ used_tables_cache(item->used_tables_cache),
forced_const(item->forced_const)
{
if (arg_count <= 2)
+ {
args=tmp_args;
+ orig_args=tmp_orig_args;
+ }
else
+ {
if (!(args= (Item**) thd->alloc(sizeof(Item*)*arg_count)))
return;
+ if (!(orig_args= (Item**) thd->alloc(sizeof(Item*)*arg_count)))
+ return;
+ }
memcpy(args, item->args, sizeof(Item*)*arg_count);
+ memcpy(orig_args, item->orig_args, sizeof(Item*)*arg_count);
}
@@ -425,12 +439,13 @@ void Item_sum::make_field(Send_field *tmp_field)
void Item_sum::print(String *str, enum_query_type query_type)
{
+ Item **pargs= orig_args;
str->append(func_name());
for (uint i=0 ; i < arg_count ; i++)
{
if (i)
str->append(',');
- args[i]->print(str, query_type);
+ pargs[i]->print(str, query_type);
}
str->append(')');
}
@@ -535,6 +550,13 @@ void Item_sum::update_used_tables ()
}
+Item *Item_sum::set_arg(int i, THD *thd, Item *new_val)
+{
+ thd->change_item_tree(args + i, new_val);
+ return new_val;
+}
+
+
String *
Item_sum_num::val_str(String *str)
{
@@ -586,6 +608,7 @@ Item_sum_num::fix_fields(THD *thd, Item **ref)
if (check_sum_func(thd, ref))
return TRUE;
+ memcpy (orig_args, args, sizeof (Item *) * arg_count);
fixed= 1;
return FALSE;
}
@@ -673,6 +696,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
if (check_sum_func(thd, ref))
return TRUE;
+ orig_args[0]= args[0];
fixed= 1;
return FALSE;
}
@@ -3141,6 +3165,12 @@ Item_func_group_concat(Name_resolution_context *context_arg,
sizeof(ORDER*)*arg_count_order)))
return;
+ if (!(orig_args= (Item **) sql_alloc(sizeof(Item *) * arg_count)))
+ {
+ args= NULL;
+ return;
+ }
+
order= (ORDER**)(args + arg_count);
/* fill args items of show and sort */
@@ -3368,6 +3398,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
if (check_sum_func(thd, ref))
return TRUE;
+ memcpy (orig_args, args, sizeof (Item *) * arg_count);
fixed= 1;
return FALSE;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index bee8792fbfa..d991327d847 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -228,10 +228,8 @@ public:
VARIANCE_FUNC, SUM_BIT_FUNC, UDF_SUM_FUNC, GROUP_CONCAT_FUNC
};
- Item **args, *tmp_args[2];
Item **ref_by; /* pointer to a ref to the object used to register it */
Item_sum *next; /* next in the circular chain of registered objects */
- uint arg_count;
Item_sum *in_sum_func; /* embedding set function if any */
st_select_lex * aggr_sel; /* select where the function is aggregated */
int8 nest_level; /* number of the nesting level of the set function */
@@ -248,24 +246,32 @@ public:
List<Item_field> outer_fields;
protected:
+ uint arg_count;
+ Item **args, *tmp_args[2];
+ /*
+ Copy of the arguments list to hold the original set of arguments.
+ Used in EXPLAIN EXTENDED instead of the current argument list because
+ the current argument list can be altered by usage of temporary tables.
+ */
+ Item **orig_args, *tmp_orig_args[2];
table_map used_tables_cache;
bool forced_const;
public:
void mark_as_sum_func();
- Item_sum() :arg_count(0), quick_group(1), forced_const(FALSE)
+ Item_sum() :quick_group(1), arg_count(0), forced_const(FALSE)
{
mark_as_sum_func();
}
- Item_sum(Item *a) :args(tmp_args), arg_count(1), quick_group(1),
- forced_const(FALSE)
+ Item_sum(Item *a) :quick_group(1), arg_count(1), args(tmp_args),
+ orig_args(tmp_orig_args), forced_const(FALSE)
{
args[0]=a;
mark_as_sum_func();
}
- Item_sum( Item *a, Item *b ) :args(tmp_args), arg_count(2), quick_group(1),
- forced_const(FALSE)
+ Item_sum( Item *a, Item *b ) :quick_group(1), arg_count(2), args(tmp_args),
+ orig_args(tmp_orig_args), forced_const(FALSE)
{
args[0]=a; args[1]=b;
mark_as_sum_func();
@@ -374,6 +380,10 @@ public:
bool register_sum_func(THD *thd, Item **ref);
st_select_lex *depended_from()
{ return (nest_level == aggr_level ? 0 : aggr_sel); }
+
+ Item *get_arg(int i) { return args[i]; }
+ Item *set_arg(int i, THD *thd, Item *new_val);
+ uint get_arg_count() { return arg_count; }
};
@@ -981,6 +991,7 @@ public:
if (udf.fix_fields(thd, this, this->arg_count, this->args))
return TRUE;
+ memcpy (orig_args, args, sizeof (Item *) * arg_count);
return check_sum_func(thd, ref);
}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
diff --git a/sql/key.cc b/sql/key.cc
index 47e5c5ebdd7..5b2ae8029dd 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -448,84 +448,104 @@ int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
}
-/*
- Compare two records in index order
- SYNOPSIS
- key_rec_cmp()
- key Index information
- rec0 Pointer to table->record[0]
- first_rec Pointer to record compare with
- second_rec Pointer to record compare against first_rec
-
- DESCRIPTION
- This method is set-up such that it can be called directly from the
- priority queue and it is attempted to be optimised as much as possible
- since this will be called O(N * log N) times while performing a merge
- sort in various places in the code.
-
- We retrieve the pointer to table->record[0] using the fact that key_parts
- have an offset making it possible to calculate the start of the record.
- We need to get the diff to the compared record since none of the records
- being compared are stored in table->record[0].
-
- We first check for NULL values, if there are no NULL values we use
- a compare method that gets two field pointers and a max length
- and return the result of the comparison.
+/**
+ Compare two records in index order.
+
+ This method is set-up such that it can be called directly from the
+ priority queue and it is attempted to be optimised as much as possible
+ since this will be called O(N * log N) times while performing a merge
+ sort in various places in the code.
+
+ We retrieve the pointer to table->record[0] using the fact that key_parts
+ have an offset making it possible to calculate the start of the record.
+ We need to get the diff to the compared record since none of the records
+ being compared are stored in table->record[0].
+
+ We first check for NULL values, if there are no NULL values we use
+ a compare method that gets two field pointers and a max length
+ and return the result of the comparison.
+
+ key is a null terminated array, since in some cases (clustered
+ primary key) it must compare more than one index.
+
+ @param key Null terminated array of index information
+ @param first_rec Pointer to record compare with
+ @param second_rec Pointer to record compare against first_rec
+
+ @return Return value is SIGN(first_rec - second_rec)
+ @retval 0 Keys are equal
+ @retval -1 second_rec is greater than first_rec
+ @retval +1 first_rec is greater than second_rec
*/
-int key_rec_cmp(void *key, uchar *first_rec, uchar *second_rec)
+int key_rec_cmp(void *key_p, uchar *first_rec, uchar *second_rec)
{
- KEY *key_info= (KEY*)key;
- uint key_parts= key_info->key_parts, i= 0;
+ KEY **key= (KEY**) key_p;
+ KEY *key_info= *(key++); // Start with first key
+ uint key_parts, key_part_num;
KEY_PART_INFO *key_part= key_info->key_part;
uchar *rec0= key_part->field->ptr - key_part->offset;
my_ptrdiff_t first_diff= first_rec - rec0, sec_diff= second_rec - rec0;
int result= 0;
+ Field *field;
DBUG_ENTER("key_rec_cmp");
+ /* loop over all given keys */
do
{
- Field *field= key_part->field;
+ key_parts= key_info->key_parts;
+ key_part= key_info->key_part;
+ key_part_num= 0;
- if (key_part->null_bit)
+ /* loop over every key part */
+ do
{
- /* The key_part can contain NULL values */
- bool first_is_null= field->is_null_in_record_with_offset(first_diff);
- bool sec_is_null= field->is_null_in_record_with_offset(sec_diff);
- /*
- NULL is smaller then everything so if first is NULL and the other
- not then we know that we should return -1 and for the opposite
- we should return +1. If both are NULL then we call it equality
- although it is a strange form of equality, we have equally little
- information of the real value.
- */
- if (!first_is_null)
+ field= key_part->field;
+
+ if (key_part->null_bit)
{
- if (!sec_is_null)
- ; /* Fall through, no NULL fields */
- else
+ /* The key_part can contain NULL values */
+ bool first_is_null= field->is_null_in_record_with_offset(first_diff);
+ bool sec_is_null= field->is_null_in_record_with_offset(sec_diff);
+ /*
+ NULL is smaller then everything so if first is NULL and the other
+ not then we know that we should return -1 and for the opposite
+ we should return +1. If both are NULL then we call it equality
+ although it is a strange form of equality, we have equally little
+ information of the real value.
+ */
+ if (!first_is_null)
{
- DBUG_RETURN(+1);
+ if (!sec_is_null)
+ ; /* Fall through, no NULL fields */
+ else
+ {
+ DBUG_RETURN(+1);
+ }
}
+ else if (!sec_is_null)
+ {
+ DBUG_RETURN(-1);
+ }
+ else
+ goto next_loop; /* Both were NULL */
}
- else if (!sec_is_null)
- {
- DBUG_RETURN(-1);
- }
- else
- goto next_loop; /* Both were NULL */
- }
- /*
- No null values in the fields
- We use the virtual method cmp_max with a max length parameter.
- For most field types this translates into a cmp without
- max length. The exceptions are the BLOB and VARCHAR field types
- that take the max length into account.
- */
- result= field->cmp_max(field->ptr+first_diff, field->ptr+sec_diff,
- key_part->length);
+ /*
+ No null values in the fields
+ We use the virtual method cmp_max with a max length parameter.
+ For most field types this translates into a cmp without
+ max length. The exceptions are the BLOB and VARCHAR field types
+ that take the max length into account.
+ */
+ if ((result= field->cmp_max(field->ptr+first_diff, field->ptr+sec_diff,
+ key_part->length)))
+ DBUG_RETURN(result);
next_loop:
- key_part++;
- } while (!result && ++i < key_parts);
- DBUG_RETURN(result);
+ key_part++;
+ key_part_num++;
+ } while (key_part_num < key_parts); /* this key is done */
+
+ key_info= *(key++);
+ } while (key_info); /* no more keys to test */
+ DBUG_RETURN(0);
}
diff --git a/sql/lock.cc b/sql/lock.cc
index dbae407d223..21255fb24b0 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -854,7 +854,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)
continue;
lock_type= table->reginfo.lock_type;
- DBUG_ASSERT (lock_type != TL_WRITE_DEFAULT);
+ DBUG_ASSERT(lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT);
if (lock_type >= TL_WRITE_ALLOW_WRITE)
{
*write_lock_used=table;
diff --git a/sql/log.cc b/sql/log.cc
index b6fe1196835..69bd785cf27 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1377,6 +1377,8 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT),
FLAGSTR(thd->options, OPTION_BEGIN)));
+ thd->binlog_flush_pending_rows_event(TRUE);
+
/*
NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of
only transactional tables. If the transaction contain changes to
@@ -1395,8 +1397,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
were, we would have to ensure that we're not ending a statement
inside a stored function.
*/
- thd->binlog_flush_pending_rows_event(TRUE);
-
error= mysql_bin_log.write(thd, &trx_data->trans_log, end_ev);
trx_data->reset();
@@ -3786,7 +3786,7 @@ THD::binlog_set_pending_rows_event(Rows_log_event* ev)
int
MYSQL_BIN_LOG::remove_pending_rows_event(THD *thd)
{
- DBUG_ENTER(__FUNCTION__);
+ DBUG_ENTER("MYSQL_BIN_LOG::remove_pending_rows_event");
binlog_trx_data *const trx_data=
(binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
@@ -4018,11 +4018,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
DBUG_PRINT("info",("number of auto_inc intervals: %u",
thd->auto_inc_intervals_in_cur_stmt_for_binlog.
nb_elements()));
- /*
- If the auto_increment was second in a table's index (possible with
- MyISAM or BDB) (table->next_number_keypart != 0), such event is
- in fact not necessary. We could avoid logging it.
- */
Intvar_log_event e(thd, (uchar) INSERT_ID_EVENT,
thd->auto_inc_intervals_in_cur_stmt_for_binlog.
minimum());
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 80eaf808647..686a7e6434e 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3350,6 +3350,17 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
close_temporary_tables(thd);
cleanup_load_tmpdir();
}
+ else
+ {
+ /*
+ Set all temporary tables thread references to the current thread
+ as they may point to the "old" SQL slave thread in case of its
+ restart.
+ */
+ TABLE *table;
+ for (table= thd->temporary_tables; table; table= table->next)
+ table->in_use= thd;
+ }
break;
/*
@@ -7195,6 +7206,9 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
error= do_exec_row(rli);
+ DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
+ DBUG_ASSERT(error != HA_ERR_RECORD_DELETED);
+
table->in_use = old_thd;
switch (error)
{
@@ -7210,11 +7224,13 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
case HA_ERR_TABLE_DEF_CHANGED:
case HA_ERR_CANNOT_ADD_FOREIGN:
-
+
which are not included into to the list.
+
+ Note that HA_ERR_RECORD_DELETED is not in the list since
+ do_exec_row() should not return that error code.
*/
case HA_ERR_RECORD_CHANGED:
- case HA_ERR_RECORD_DELETED:
case HA_ERR_KEY_NOT_FOUND:
case HA_ERR_END_OF_FILE:
case HA_ERR_FOUND_DUPP_KEY:
@@ -7223,7 +7239,6 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
case HA_ERR_NO_REFERENCED_ROW:
case HA_ERR_ROW_IS_REFERENCED:
- DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
{
if (global_system_variables.log_warnings)
@@ -7246,7 +7261,6 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
m_curr_row_end.
*/
- DBUG_PRINT("info", ("error: %d", error));
DBUG_PRINT("info", ("curr_row: 0x%lu; curr_row_end: 0x%lu; rows_end: 0x%lu",
(ulong) m_curr_row, (ulong) m_curr_row_end, (ulong) m_rows_end));
@@ -8064,7 +8078,6 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability
*/
}
- m_table->file->ha_start_bulk_insert(0);
/*
We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill
any TIMESTAMP column with data from the row but instead will use
@@ -8203,7 +8216,16 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
/* unpack row into table->record[0] */
error= unpack_current_row(rli); // TODO: how to handle errors?
-
+ if (m_curr_row == m_rows_buf)
+ {
+ /* this is the first row to be inserted, we estimate the rows with
+ the size of the first row and use that value to initialize
+ storage engine for bulk insertion */
+ ulong estimated_rows= (m_rows_end - m_curr_row) / (m_curr_row_end - m_curr_row);
+ m_table->file->ha_start_bulk_insert(estimated_rows);
+ }
+
+
#ifndef DBUG_OFF
DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set);
@@ -8253,6 +8275,8 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
if (error)
{
DBUG_PRINT("info",("rnd_pos() returns error %d",error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -8285,7 +8309,9 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
HA_READ_KEY_EXACT);
if (error)
{
- DBUG_PRINT("info",("index_read_idx() returns error %d",error));
+ DBUG_PRINT("info",("index_read_idx() returns %s", HA_ERR(error)));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -8558,6 +8584,8 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
if (error)
{
DBUG_PRINT("info",("rnd_pos returns error %d",error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
}
DBUG_RETURN(error);
@@ -8608,15 +8636,17 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
the necessary bits on the bytes and don't set the filler bits
correctly.
*/
- my_ptrdiff_t const pos=
- table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
- table->record[0][pos]= 0xFF;
-
+ if (table->s->null_bytes > 0)
+ table->record[0][table->s->null_bytes - 1]|=
+ 256U - (1U << table->s->last_null_bit_pos);
+
if ((error= table->file->index_read_map(table->record[0], m_key,
HA_WHOLE_KEY,
HA_READ_KEY_EXACT)))
{
DBUG_PRINT("info",("no record matching the key found in the table"));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
goto err;
@@ -8674,8 +8704,11 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
256U - (1U << table->s->last_null_bit_pos);
}
- if ((error= table->file->index_next(table->record[0])))
+ while ((error= table->file->index_next(table->record[0])))
{
+ /* We just skip records that has already been deleted */
+ if (error == HA_ERR_RECORD_DELETED)
+ continue;
DBUG_PRINT("info",("no record matching the given row found"));
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
@@ -8706,14 +8739,22 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
/* Continue until we find the right record or have made a full loop */
do
{
+ restart_rnd_next:
error= table->file->rnd_next(table->record[0]);
+ DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
switch (error) {
case 0:
- case HA_ERR_RECORD_DELETED:
break;
+ /*
+ If the record was deleted, we pick the next one without doing
+ any comparisons.
+ */
+ case HA_ERR_RECORD_DELETED:
+ goto restart_rnd_next;
+
case HA_ERR_END_OF_FILE:
if (++restart_count < 2)
table->file->ha_rnd_init(1);
@@ -8743,7 +8784,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_DUMP("record found", table->record[0], table->s->reclength);
table->file->ha_rnd_end();
- DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == HA_ERR_RECORD_DELETED || error == 0);
+ DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);
goto err;
}
ok:
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 96076b5c199..6ee2a4549e6 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -556,6 +556,9 @@ replace_record(THD *thd, TABLE *table,
error= table->file->rnd_pos(table->record[1], table->file->dup_ref);
if (error)
{
+ DBUG_PRINT("info",("rnd_pos() returns error %d",error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -582,6 +585,9 @@ replace_record(THD *thd, TABLE *table,
HA_READ_KEY_EXACT);
if (error)
{
+ DBUG_PRINT("info", ("index_read_idx() returns error %d", error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -787,11 +793,14 @@ static int find_and_fetch_row(TABLE *table, uchar *key)
256U - (1U << table->s->last_null_bit_pos);
}
- if ((error= table->file->index_next(table->record[1])))
+ while ((error= table->file->index_next(table->record[1])))
{
- table->file->print_error(error, MYF(0));
+ /* We just skip records that has already been deleted */
+ if (error == HA_ERR_RECORD_DELETED)
+ continue;
+ table->file->print_error(error, MYF(0));
table->file->ha_index_end();
- DBUG_RETURN(error);
+ DBUG_RETURN(error);
}
}
@@ -812,6 +821,7 @@ static int find_and_fetch_row(TABLE *table, uchar *key)
/* Continue until we find the right record or have made a full loop */
do
{
+ restart_rnd_next:
error= table->file->rnd_next(table->record[1]);
DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
@@ -819,8 +829,14 @@ static int find_and_fetch_row(TABLE *table, uchar *key)
switch (error) {
case 0:
+ break;
+
+ /*
+ If the record was deleted, we pick the next one without doing
+ any comparisons.
+ */
case HA_ERR_RECORD_DELETED:
- break;
+ goto restart_rnd_next;
case HA_ERR_END_OF_FILE:
if (++restart_count < 2)
@@ -1680,6 +1696,9 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
error= do_exec_row(rli);
+ DBUG_PRINT("info", ("error: %d", error));
+ DBUG_ASSERT(error != HA_ERR_RECORD_DELETED);
+
table->in_use = old_thd;
switch (error)
{
@@ -2100,6 +2119,8 @@ Old_rows_log_event::write_row(const Relay_log_info *const rli,
if (error)
{
DBUG_PRINT("info",("rnd_pos() returns error %d",error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -2132,7 +2153,9 @@ Old_rows_log_event::write_row(const Relay_log_info *const rli,
HA_READ_KEY_EXACT);
if (error)
{
- DBUG_PRINT("info",("index_read_idx() returns error %d",error));
+ DBUG_PRINT("info",("index_read_idx() returns error %d", error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -2288,6 +2311,8 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
if (error)
{
DBUG_PRINT("info",("rnd_pos returns error %d",error));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
}
DBUG_RETURN(error);
@@ -2347,6 +2372,8 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
HA_READ_KEY_EXACT)))
{
DBUG_PRINT("info",("no record matching the key found in the table"));
+ if (error == HA_ERR_RECORD_DELETED)
+ error= HA_ERR_KEY_NOT_FOUND;
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
DBUG_RETURN(error);
@@ -2404,8 +2431,11 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
256U - (1U << table->s->last_null_bit_pos);
}
- if ((error= table->file->index_next(table->record[0])))
+ while ((error= table->file->index_next(table->record[0])))
{
+ /* We just skip records that has already been deleted */
+ if (error == HA_ERR_RECORD_DELETED)
+ continue;
DBUG_PRINT("info",("no record matching the given row found"));
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
@@ -2436,14 +2466,17 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
/* Continue until we find the right record or have made a full loop */
do
{
+ restart_rnd_next:
error= table->file->rnd_next(table->record[0]);
switch (error) {
case 0:
- case HA_ERR_RECORD_DELETED:
break;
+ case HA_ERR_RECORD_DELETED:
+ goto restart_rnd_next;
+
case HA_ERR_END_OF_FILE:
if (++restart_count < 2)
table->file->ha_rnd_init(1);
diff --git a/sql/message.h b/sql/message.h
new file mode 100644
index 00000000000..0e7c282d5a1
--- /dev/null
+++ b/sql/message.h
@@ -0,0 +1,55 @@
+/*
+ To change or add messages mysqld writes to the Windows error log, run
+ mc.exe message.mc
+ and checkin generated messages.h, messages.rc and msg000001.bin under the
+ source control.
+ mc.exe can be installed with Windows SDK, some Visual Studio distributions
+ do not include it.
+*/
+//
+// Values are 32 bit values layed out as follows:
+//
+// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+// +---+-+-+-----------------------+-------------------------------+
+// |Sev|C|R| Facility | Code |
+// +---+-+-+-----------------------+-------------------------------+
+//
+// where
+//
+// Sev - is the severity code
+//
+// 00 - Success
+// 01 - Informational
+// 10 - Warning
+// 11 - Error
+//
+// C - is the Customer code flag
+//
+// R - is a reserved bit
+//
+// Facility - is the facility code
+//
+// Code - is the facility's status code
+//
+//
+// Define the facility codes
+//
+
+
+//
+// Define the severity codes
+//
+
+
+//
+// MessageId: MSG_DEFAULT
+//
+// MessageText:
+//
+// %1For more information, see Help and Support Center at http://www.mysql.com.
+//
+//
+//
+#define MSG_DEFAULT 0xC0000064L
+
diff --git a/sql/message.mc b/sql/message.mc
index a1a7c8cff7e..8d68d599365 100644
--- a/sql/message.mc
+++ b/sql/message.mc
@@ -1,3 +1,11 @@
+;/*
+; To change or add messages mysqld writes to the Windows error log, run
+; mc.exe message.mc
+; and checkin generated messages.h, messages.rc and msg000001.bin under the
+; source control.
+; mc.exe can be installed with Windows SDK, some Visual Studio distributions
+; do not include it.
+;*/
MessageId = 100
Severity = Error
Facility = Application
diff --git a/sql/message.rc b/sql/message.rc
new file mode 100644
index 00000000000..116522b7d48
--- /dev/null
+++ b/sql/message.rc
@@ -0,0 +1,2 @@
+LANGUAGE 0x9,0x1
+1 11 MSG00001.bin
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index d4182ce5474..bbb724c4ffd 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -801,6 +801,7 @@ bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
bool check_string_char_length(LEX_STRING *str, const char *err_msg,
uint max_char_length, CHARSET_INFO *cs,
bool no_error);
+bool check_host_name(LEX_STRING *str);
bool parse_sql(THD *thd,
Parser_state *parser_state,
@@ -1266,6 +1267,7 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last,
TABLE_LIST *new_child_list, TABLE_LIST **new_last);
bool reopen_table(TABLE *table);
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
+thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table);
void close_data_files_and_morph_locks(THD *thd, const char *db,
const char *table_name);
void close_handle_and_leave_table_as_lock(TABLE *table);
@@ -1939,7 +1941,7 @@ extern bool opt_using_transactions;
extern bool mysqld_embedded;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
-extern bool using_update_log, opt_large_files, server_id_supplied;
+extern bool opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log;
extern ulong log_output_options;
@@ -2246,6 +2248,7 @@ uint build_table_shadow_filename(char *buff, size_t bufflen,
#define FN_TO_IS_TMP (1 << 1)
#define FN_IS_TMP (FN_FROM_IS_TMP | FN_TO_IS_TMP)
#define NO_FRM_RENAME (1 << 2)
+#define FRM_ONLY (1 << 3)
/* from hostname.cc */
struct in_addr;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 3b176e8d37f..acfa6095a30 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -384,7 +384,7 @@ my_bool opt_character_set_client_handshake= 1;
bool server_id_supplied = 0;
bool opt_endinfo, using_udf_functions;
my_bool locked_in_memory;
-bool opt_using_transactions, using_update_log;
+bool opt_using_transactions;
bool volatile abort_loop;
bool volatile shutdown_in_progress;
/**
@@ -2809,11 +2809,24 @@ int my_message_sql(uint error, const char *str, myf MyFlags)
sql_print_message_func func;
DBUG_ENTER("my_message_sql");
DBUG_PRINT("error", ("error: %u message: '%s'", error, str));
+
+ DBUG_ASSERT(str != NULL);
/*
- Put here following assertion when situation with EE_* error codes
- will be fixed
+ An error should have a valid error number (!= 0), so it can be caught
+ in stored procedures by SQL exception handlers.
+ Calling my_error() with error == 0 is a bug.
+ Remaining known places to fix:
+ - storage/myisam/mi_create.c, my_printf_error()
+ TODO:
DBUG_ASSERT(error != 0);
*/
+ if (error == 0)
+ {
+ /* At least, prevent new abuse ... */
+ DBUG_ASSERT(strncmp(str, "MyISAM table", 12) == 0);
+ error= ER_UNKNOWN_ERROR;
+ }
+
if (MyFlags & ME_JUST_INFO)
{
level= MYSQL_ERROR::WARN_LEVEL_NOTE;
@@ -2864,10 +2877,6 @@ int my_message_sql(uint error, const char *str, myf MyFlags)
{
if (! thd->main_da.is_error()) // Return only first message
{
- if (error == 0)
- error= ER_UNKNOWN_ERROR;
- if (str == NULL)
- str= ER(error);
thd->main_da.set_error_status(thd, error, str);
}
query_cache_abort(&thd->net);
@@ -3414,7 +3423,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
if (opt_slow_log && opt_slow_logname && !(log_output_options & LOG_FILE)
&& !(log_output_options & LOG_NONE))
sql_print_warning("Although a path was specified for the "
- "--log-slow-queries option, log tables are used. "
+ "--log_slow_queries option, log tables are used. "
"To enable logging to files use the --log-output=file option.");
s= opt_logname ? opt_logname : make_default_log_name(buff, ".log");
@@ -3792,23 +3801,25 @@ with --log-bin instead.");
unireg_abort(1);
}
if (!opt_bin_log)
- if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC)
{
- sql_print_error("You need to use --log-bin to make "
- "--binlog-format work.");
- unireg_abort(1);
- }
+ if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC)
+ {
+ sql_print_error("You need to use --log-bin to make "
+ "--binlog-format work.");
+ unireg_abort(1);
+ }
else
- {
- global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
+ {
+ global_system_variables.binlog_format= BINLOG_FORMAT_STMT;
}
+ }
else
if (opt_binlog_format_id == BINLOG_FORMAT_UNSPEC)
- global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
+ global_system_variables.binlog_format= BINLOG_FORMAT_STMT;
else
{
DBUG_ASSERT(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
- }
+ }
/* Check that we have not let the format to unspecified at this point */
DBUG_ASSERT((uint)global_system_variables.binlog_format <=
@@ -3854,12 +3865,6 @@ server.");
{
unireg_abort(1);
}
-
- /*
- Used to specify which type of lock we need to use for queries of type
- INSERT ... SELECT. This will change when we have row level logging.
- */
- using_update_log=1;
}
/* call ha_init_key_cache() on all key caches to init them */
@@ -5590,7 +5595,9 @@ enum options_mysqld
OPT_DEADLOCK_SEARCH_DEPTH_SHORT,
OPT_DEADLOCK_SEARCH_DEPTH_LONG,
OPT_DEADLOCK_TIMEOUT_SHORT,
- OPT_DEADLOCK_TIMEOUT_LONG
+ OPT_DEADLOCK_TIMEOUT_LONG,
+ OPT_GENERAL_LOG_FILE,
+ OPT_SLOW_QUERY_LOG_FILE
};
@@ -5812,7 +5819,7 @@ struct my_option my_long_options[] =
"Set up signals usable for debugging",
(uchar**) &opt_debugging, (uchar**) &opt_debugging,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"general-log", OPT_GENERAL_LOG,
+ {"general_log", OPT_GENERAL_LOG,
"Enable|disable general log", (uchar**) &opt_log,
(uchar**) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_LARGE_PAGES
@@ -5848,8 +5855,12 @@ Disable with --skip-large-pages.",
(uchar**) &opt_local_infile,
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
1, 0, 0, 0, 0, 0},
- {"log", 'l', "Log connections and queries to file.", (uchar**) &opt_logname,
+ {"log", 'l', "Log connections and queries to file (deprecated option, use "
+ "--general_log/--general_log_file instead).", (uchar**) &opt_logname,
(uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"general_log_file", OPT_GENERAL_LOG_FILE,
+ "Log connections and queries to given file.", (uchar**) &opt_logname,
+ (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
"Log update queries in binary format. Optional (but strongly recommended "
"to avoid replication problems if server's hostname changes) argument "
@@ -5923,10 +5934,17 @@ Disable with --skip-large-pages.",
(uchar**) &opt_log_slow_slave_statements,
(uchar**) &opt_log_slow_slave_statements,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slow-queries", OPT_SLOW_QUERY_LOG,
- "Log slow queries to a table or log file. Defaults logging to table mysql.slow_log or hostname-slow.log if --log-output=file is used. Must be enabled to activate other slow log options.",
+ {"log_slow_queries", OPT_SLOW_QUERY_LOG,
+ "Log slow queries to a table or log file. Defaults logging to table "
+ "mysql.slow_log or hostname-slow.log if --log-output=file is used. "
+ "Must be enabled to activate other slow log options. "
+ "(deprecated option, use --slow_query_log/--slow_query_log_file instead)",
(uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
+ {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE,
+ "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.",
+ (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"log-tc", OPT_LOG_TC,
"Path to transaction coordinator log (used for transactions that affect "
"more than one storage engine, when binary log is disabled)",
@@ -6308,7 +6326,7 @@ Can't be set to 1 if --log-slave-updates is used.",
{"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Deprecated option. Use --skip-symbolic-links instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-thread-priority", OPT_SKIP_PRIOR,
- "Don't give threads different priorities.", 0, 0, 0, GET_NO_ARG, NO_ARG,
+ "Don't give threads different priorities. Deprecated option.", 0, 0, 0, GET_NO_ARG, NO_ARG,
DEFAULT_SKIP_THREAD_PRIORITY, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
{"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
@@ -6722,9 +6740,10 @@ The minimum value for this variable is 4096.",
"Directory for plugins.",
(uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"plugin_load", OPT_PLUGIN_LOAD,
- "Optional colon separated list of plugins to load, where each plugin is "
- "identified by name and path to library seperated by an equals.",
+ {"plugin-load", OPT_PLUGIN_LOAD,
+ "Optional colon-separated list of plugins to load, where each plugin is "
+ "identified as name=library, where name is the plugin name and library "
+ "is the plugin library in plugin_dir.",
(uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
@@ -7512,7 +7531,7 @@ static void mysql_init_variables(void)
slave_open_temp_tables= 0;
cached_thread_count= 0;
opt_endinfo= using_udf_functions= 0;
- opt_using_transactions= using_update_log= 0;
+ opt_using_transactions= 0;
abort_loop= select_thread_in_use= signal_thread_in_use= 0;
ready_to_exit= shutdown_in_progress= grant_option= 0;
aborted_threads= aborted_connects= 0;
@@ -7623,13 +7642,13 @@ static void mysql_init_variables(void)
have_community_features = SHOW_OPTION_YES;
#else
have_community_features = SHOW_OPTION_NO;
+#endif
global_system_variables.ndb_index_stat_enable=FALSE;
max_system_variables.ndb_index_stat_enable=TRUE;
global_system_variables.ndb_index_stat_cache_entries=32;
max_system_variables.ndb_index_stat_cache_entries=~0L;
global_system_variables.ndb_index_stat_update_freq=20;
max_system_variables.ndb_index_stat_update_freq=~0L;
-#endif
#ifdef HAVE_OPENSSL
have_ssl=SHOW_OPTION_YES;
#else
@@ -7747,6 +7766,7 @@ mysqld_get_one_option(int optid,
default_collation_name= 0;
break;
case 'l':
+ WARN_DEPRECATED(NULL, "7.0", "--log", "'--general_log'/'--general_log_file'");
opt_log=1;
break;
case 'h':
@@ -7916,6 +7936,7 @@ mysqld_get_one_option(int optid,
}
#endif /* HAVE_REPLICATION */
case (int) OPT_SLOW_QUERY_LOG:
+ WARN_DEPRECATED(NULL, "7.0", "--log_slow_queries", "'--slow_query_log'/'--slow_query_log_file'");
opt_slow_log= 1;
break;
#ifdef WITH_CSV_STORAGE_ENGINE
@@ -7963,6 +7984,9 @@ mysqld_get_one_option(int optid,
break;
case (int) OPT_SKIP_PRIOR:
opt_specialflag|= SPECIAL_NO_PRIOR;
+ sql_print_warning("The --skip-thread-priority startup option is deprecated "
+ "and will be removed in MySQL 7.0. MySQL 6.0 and up do not "
+ "give threads different priorities.");
break;
case (int) OPT_SKIP_LOCK:
opt_external_locking=0;
@@ -8305,7 +8329,7 @@ static void get_options(int *argc,char **argv)
if ((opt_log_slow_admin_statements || opt_log_queries_not_using_indexes ||
opt_log_slow_slave_statements) &&
!opt_slow_log)
- sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log-slow-queries is not set");
+ sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set");
#if defined(HAVE_BROKEN_REALPATH)
my_use_symdir=0;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 28ee8af0699..bafc368e415 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -574,6 +574,7 @@ public:
keys_map.clear_all();
bzero((char*) keys,sizeof(keys));
}
+ SEL_TREE(SEL_TREE *arg, RANGE_OPT_PARAM *param);
/*
Note: there may exist SEL_TREE objects with sel_tree->type=KEY and
keys[i]=0 for all i. (SergeyP: it is not clear whether there is any
@@ -767,6 +768,7 @@ public:
trees_next(trees),
trees_end(trees + PREALLOCED_TREES)
{}
+ SEL_IMERGE (SEL_IMERGE *arg, RANGE_OPT_PARAM *param);
int or_sel_tree(RANGE_OPT_PARAM *param, SEL_TREE *tree);
int or_sel_tree_with_checks(RANGE_OPT_PARAM *param, SEL_TREE *new_tree);
int or_sel_imerge_with_checks(RANGE_OPT_PARAM *param, SEL_IMERGE* imerge);
@@ -883,6 +885,61 @@ int SEL_IMERGE::or_sel_imerge_with_checks(RANGE_OPT_PARAM *param, SEL_IMERGE* im
}
+SEL_TREE::SEL_TREE(SEL_TREE *arg, RANGE_OPT_PARAM *param): Sql_alloc()
+{
+ keys_map= arg->keys_map;
+ type= arg->type;
+ for (int idx= 0; idx < MAX_KEY; idx++)
+ {
+ if ((keys[idx]= arg->keys[idx]))
+ keys[idx]->increment_use_count(1);
+ }
+
+ List_iterator<SEL_IMERGE> it(arg->merges);
+ for (SEL_IMERGE *el= it++; el; el= it++)
+ {
+ SEL_IMERGE *merge= new SEL_IMERGE(el, param);
+ if (!merge || merge->trees == merge->trees_next)
+ {
+ merges.empty();
+ return;
+ }
+ merges.push_back (merge);
+ }
+}
+
+
+SEL_IMERGE::SEL_IMERGE (SEL_IMERGE *arg, RANGE_OPT_PARAM *param) : Sql_alloc()
+{
+ uint elements= (arg->trees_end - arg->trees);
+ if (elements > PREALLOCED_TREES)
+ {
+ uint size= elements * sizeof (SEL_TREE **);
+ if (!(trees= (SEL_TREE **)alloc_root(param->mem_root, size)))
+ goto mem_err;
+ }
+ else
+ trees= &trees_prealloced[0];
+
+ trees_next= trees;
+ trees_end= trees + elements;
+
+ for (SEL_TREE **tree = trees, **arg_tree= arg->trees; tree < trees_end;
+ tree++, arg_tree++)
+ {
+ if (!(*tree= new SEL_TREE(*arg_tree, param)))
+ goto mem_err;
+ }
+
+ return;
+
+mem_err:
+ trees= &trees_prealloced[0];
+ trees_next= trees;
+ trees_end= trees;
+}
+
+
/*
Perform AND operation on two index_merge lists and store result in *im1.
*/
@@ -942,10 +999,23 @@ int imerge_list_or_tree(RANGE_OPT_PARAM *param,
{
SEL_IMERGE *imerge;
List_iterator<SEL_IMERGE> it(*im1);
+ bool tree_used= FALSE;
while ((imerge= it++))
{
- if (imerge->or_sel_tree_with_checks(param, tree))
+ SEL_TREE *or_tree;
+ if (tree_used)
+ {
+ or_tree= new SEL_TREE (tree, param);
+ if (!or_tree ||
+ (or_tree->keys_map.is_clear_all() && or_tree->merges.is_empty()))
+ return FALSE;
+ }
+ else
+ or_tree= tree;
+
+ if (imerge->or_sel_tree_with_checks(param, or_tree))
it.remove();
+ tree_used= TRUE;
}
return im1->is_empty();
}
@@ -1081,7 +1151,7 @@ int QUICK_RANGE_SELECT::init()
if (file->inited != handler::NONE)
file->ha_index_or_rnd_end();
- DBUG_RETURN(error= file->ha_index_init(index, 1));
+ DBUG_RETURN(FALSE);
}
@@ -3145,10 +3215,12 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
ppar->subpart_fields););
/* Find the subpartition (it's HASH/KEY so we always have one) */
partition_info *part_info= ppar->part_info;
- uint32 subpart_id= part_info->get_subpartition_id(part_info);
-
+ uint32 part_id, subpart_id;
+
+ if (part_info->get_subpartition_id(part_info, &subpart_id))
+ return 0;
+
/* Mark this partition as used in each subpartition. */
- uint32 part_id;
while ((part_id= ppar->part_iter.get_next(&ppar->part_iter)) !=
NOT_A_PARTITION_ID)
{
@@ -5547,7 +5619,9 @@ get_mm_parts(RANGE_OPT_PARAM *param, COND *cond_func, Field *field,
tree->keys_map.set_bit(key_part->key);
}
}
-
+
+ if (tree && tree->merges.is_empty() && tree->keys_map.is_clear_all())
+ tree= NULL;
DBUG_RETURN(tree);
}
@@ -9126,7 +9200,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
DBUG_RETURN(NULL);
/* The argument of MIN/MAX. */
- Item *expr= min_max_item->args[0]->real_item();
+ Item *expr= min_max_item->get_arg(0)->real_item();
if (expr->type() == Item::FIELD_ITEM) /* Is it an attribute? */
{
if (! min_max_arg_item)
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 334eae55265..f0f856c3c6a 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -199,7 +199,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
to the number of rows in the tables if this number is exact and
there are no outer joins.
*/
- if (!conds && !((Item_sum_count*) item)->args[0]->maybe_null &&
+ if (!conds && !((Item_sum_count*) item)->get_arg(0)->maybe_null &&
!outer_tables && maybe_exact_count)
{
if (!is_exact_count)
@@ -225,7 +225,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
parts of the key is found in the COND, then we can use
indexes to find the key.
*/
- Item *expr=item_sum->args[0];
+ Item *expr=item_sum->get_arg(0);
if (expr->real_item()->type() == Item::FIELD_ITEM)
{
uchar key_buff[MAX_KEY_LENGTH];
@@ -373,7 +373,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
parts of the key is found in the COND, then we can use
indexes to find the key.
*/
- Item *expr=item_sum->args[0];
+ Item *expr=item_sum->get_arg(0);
if (expr->real_item()->type() == Item::FIELD_ITEM)
{
uchar key_buff[MAX_KEY_LENGTH];
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index 1f0a45edd5e..d8cbc7ff174 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -26,6 +26,9 @@
#include <my_sys.h>
#include <my_dir.h>
+/* from sql_db.cc */
+extern long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path);
+
/**
Write string with escaping.
@@ -282,8 +285,9 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
DBUG_RETURN(TRUE);
}
- // archive copies management
path[path_end]='\0';
+#ifdef FRM_ARCHIVE
+ // archive copies management: disabled unused feature (see bug #17823).
if (!access(path, F_OK))
{
if (old_version != ULONGLONG_MAX && max_versions != 0)
@@ -330,6 +334,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
}
}
}
+#endif//FRM_ARCHIVE
{
// rename temporary file
@@ -352,6 +357,7 @@ err_w_file:
/**
Renames a frm file (including backups) in same schema.
+ @thd thread handler
@param schema name of given schema
@param old_name original file name
@param new_name new file name
@@ -363,7 +369,8 @@ err_w_file:
@retval
1 Error (only if renaming of frm failed)
*/
-my_bool rename_in_schema_file(const char *schema, const char *old_name,
+my_bool rename_in_schema_file(THD *thd,
+ const char *schema, const char *old_name,
const char *new_name, ulonglong revision,
uint num_view_backups)
{
@@ -377,9 +384,10 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name,
if (my_rename(old_path, new_path, MYF(MY_WME)))
return 1;
- /* check if arc_dir exists */
+ /* check if arc_dir exists: disabled unused feature (see bug #17823). */
build_table_filename(arc_path, sizeof(arc_path) - 1, schema, "arc", "", 0);
+#ifdef FRM_ARCHIVE
if (revision > 0 && !access(arc_path, F_OK))
{
char old_name_buf[FN_REFLEN], new_name_buf[FN_REFLEN];
@@ -400,6 +408,16 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name,
my_rename(old_path, new_path, MYF(0));
}
}
+#else//FRM_ARCHIVE
+ { // remove obsolete 'arc' directory and files if any
+ MY_DIR *new_dirp;
+ if ((new_dirp = my_dir(arc_path, MYF(MY_DONT_SORT))))
+ {
+ DBUG_PRINT("my",("Archive subdir found: %s", arc_path));
+ (void) mysql_rm_arc_files(thd, new_dirp, arc_path);
+ }
+ }
+#endif//FRM_ARCHIVE
return 0;
}
diff --git a/sql/parse_file.h b/sql/parse_file.h
index 30c902478b8..c05b2853b9a 100644
--- a/sql/parse_file.h
+++ b/sql/parse_file.h
@@ -82,8 +82,9 @@ my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
const LEX_STRING *type,
uchar* base, File_option *parameters, uint versions);
-my_bool rename_in_schema_file(const char *schema, const char *old_name,
- const char *new_name, ulonglong revision,
+my_bool rename_in_schema_file(THD *thd,
+ const char *schema, const char *old_name,
+ const char *new_name, ulonglong revision,
uint num_view_backups);
class File_parser: public Sql_alloc
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 808f305db2c..dfdd29975ac 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -956,11 +956,13 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
#endif
{
if (part_elem->data_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "DATA DIRECTORY option ignored");
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "DATA DIRECTORY");
if (part_elem->index_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "INDEX DIRECTORY option ignored");
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "INDEX DIRECTORY");
part_elem->data_file_name= part_elem->index_file_name= NULL;
}
if (!is_sub_partitioned())
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 2af7fa1717c..703b92305b1 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -25,8 +25,9 @@ class partition_info;
typedef int (*get_part_id_func)(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
-typedef uint32 (*get_subpart_id_func)(partition_info *part_info);
-
+typedef int (*get_subpart_id_func)(partition_info *part_info,
+ uint32 *part_id);
+
struct st_ddl_log_memory_entry;
class partition_info : public Sql_alloc
diff --git a/sql/set_var.cc b/sql/set_var.cc
index df1badebc50..cd33ae16e65 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1747,119 +1747,6 @@ err:
}
-/**
- Return an Item for a variable.
-
- Used with @@[global.]variable_name.
-
- If type is not given, return local value if exists, else global.
-*/
-
-Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
-{
- if (check_type(var_type))
- {
- if (var_type != OPT_DEFAULT)
- {
- my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0),
- name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL");
- return 0;
- }
- /* As there was no local variable, return the global value */
- var_type= OPT_GLOBAL;
- }
- switch (show_type()) {
- case SHOW_INT:
- {
- uint value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- value= *(uint*) value_ptr(thd, var_type, base);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_uint((ulonglong) value);
- }
- case SHOW_LONG:
- {
- ulong value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- value= *(ulong*) value_ptr(thd, var_type, base);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_uint((ulonglong) value);
- }
- case SHOW_LONGLONG:
- {
- longlong value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- value= *(longlong*) value_ptr(thd, var_type, base);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_int(value);
- }
- case SHOW_DOUBLE:
- {
- double value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- value= *(double*) value_ptr(thd, var_type, base);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- /* 6, as this is for now only used with microseconds */
- return new Item_float(value, 6);
- }
- case SHOW_HA_ROWS:
- {
- ha_rows value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- value= *(ha_rows*) value_ptr(thd, var_type, base);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_int((ulonglong) value);
- }
- case SHOW_MY_BOOL:
- {
- int32 value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- value= *(my_bool*) value_ptr(thd, var_type, base);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_int(value,1);
- }
- case SHOW_CHAR_PTR:
- {
- Item *tmp;
- pthread_mutex_lock(&LOCK_global_system_variables);
- char *str= *(char**) value_ptr(thd, var_type, base);
- if (str)
- {
- uint length= strlen(str);
- tmp= new Item_string(thd->strmake(str, length), length,
- system_charset_info, DERIVATION_SYSCONST);
- }
- else
- {
- tmp= new Item_null();
- tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
- }
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return tmp;
- }
- case SHOW_CHAR:
- {
- Item *tmp;
- pthread_mutex_lock(&LOCK_global_system_variables);
- char *str= (char*) value_ptr(thd, var_type, base);
- if (str)
- tmp= new Item_string(str, strlen(str),
- system_charset_info, DERIVATION_SYSCONST);
- else
- {
- tmp= new Item_null();
- tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
- }
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return tmp;
- }
- default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), name);
- }
- return 0;
-}
-
-
bool sys_var_thd_enum::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
@@ -2403,6 +2290,12 @@ end:
bool sys_var_log_state::update(THD *thd, set_var *var)
{
bool res;
+
+ if (this == &sys_var_log)
+ WARN_DEPRECATED(thd, "7.0", "@@log", "'@@general_log'");
+ else if (this == &sys_var_log_slow)
+ WARN_DEPRECATED(thd, "7.0", "@@log_slow_queries", "'@@slow_query_log'");
+
pthread_mutex_lock(&LOCK_global_system_variables);
if (!var->save_result.ulong_value)
{
@@ -2417,6 +2310,11 @@ bool sys_var_log_state::update(THD *thd, set_var *var)
void sys_var_log_state::set_default(THD *thd, enum_var_type type)
{
+ if (this == &sys_var_log)
+ WARN_DEPRECATED(thd, "7.0", "@@log", "'@@general_log'");
+ else if (this == &sys_var_log_slow)
+ WARN_DEPRECATED(thd, "7.0", "@@log_slow_queries", "'@@slow_query_log'");
+
pthread_mutex_lock(&LOCK_global_system_variables);
logger.deactivate_log_handler(thd, log_type);
pthread_mutex_unlock(&LOCK_global_system_variables);
@@ -3723,7 +3621,7 @@ bool sys_var_thd_storage_engine::update(THD *thd, set_var *var)
void sys_var_thd_table_type::warn_deprecated(THD *thd)
{
- WARN_DEPRECATED(thd, "5.2", "table_type", "'storage_engine'");
+ WARN_DEPRECATED(thd, "5.2", "@@table_type", "'@@storage_engine'");
}
void sys_var_thd_table_type::set_default(THD *thd, enum_var_type type)
@@ -3985,8 +3883,8 @@ bool process_key_caches(process_key_cache_t func)
void sys_var_trust_routine_creators::warn_deprecated(THD *thd)
{
- WARN_DEPRECATED(thd, "5.2", "log_bin_trust_routine_creators",
- "'log_bin_trust_function_creators'");
+ WARN_DEPRECATED(thd, "5.2", "@@log_bin_trust_routine_creators",
+ "'@@log_bin_trust_function_creators'");
}
void sys_var_trust_routine_creators::set_default(THD *thd, enum_var_type type)
diff --git a/sql/set_var.h b/sql/set_var.h
index 8ae97c6502d..9681c955a98 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -105,7 +105,6 @@ public:
{ return type != INT_RESULT; } /* Assume INT */
virtual bool check_default(enum_var_type type)
{ return option_limits == 0; }
- Item *item(THD *thd, enum_var_type type, LEX_STRING *base);
virtual bool is_struct() { return 0; }
virtual bool is_readonly() const { return 0; }
virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 84eb5f5ba64..b86007408fb 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -6128,8 +6128,26 @@ ER_LOAD_DATA_INVALID_COLUMN
ER_LOG_PURGE_NO_FILE
eng "Being purged log %s was not found"
+ER_XA_RBTIMEOUT XA106
+ eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long"
+
+ER_XA_RBDEADLOCK XA102
+ eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected"
+
ER_NEED_REPREPARE
eng "Prepared statement needs to be re-prepared"
ER_DELAYED_NOT_SUPPORTED
eng "DELAYED option not supported for table '%-.192s'"
+
+WARN_NO_MASTER_INFO
+ eng "The master info structure does not exist"
+
+WARN_OPTION_IGNORED
+ eng "<%-.64s> option ignored"
+
+WARN_PLUGIN_DELETE_BUILTIN
+ eng "Built-in plugins cannot be deleted"
+
+WARN_PLUGIN_BUSY
+ eng "Plugin is busy and will be uninstalled on shutdown"
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index d1f920fd3a5..534cd0a7ca1 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -126,6 +126,9 @@ sp_get_item_value(THD *thd, Item *item, String *str)
if (cs->escape_with_backslash_is_dangerous)
buf.append(' ');
append_query_string(cs, result, &buf);
+ buf.append(" COLLATE '");
+ buf.append(item->collation.collation->name);
+ buf.append('\'');
str->copy(buf);
return str;
@@ -1940,10 +1943,14 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
we'll leave it here.
*/
if (!thd->in_sub_stmt)
- close_thread_tables(thd);
+ {
+ thd->lex->unit.cleanup();
+ close_thread_tables(thd);
+ thd->rollback_item_tree_changes();
+ }
- DBUG_PRINT("info",(" %.*s: eval args done",
- (int) m_name.length, m_name.str));
+ DBUG_PRINT("info",(" %.*s: eval args done", (int) m_name.length,
+ m_name.str));
}
if (!(m_flags & LOG_SLOW_STATEMENTS) && thd->enable_slow_log)
{
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 0b993748fc3..7ecbce4154a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -489,12 +489,20 @@ static TABLE_SHARE
"no such table" errors.
@todo Rework the alternative ways to deal with ER_NO_SUCH TABLE.
*/
- if (thd->is_error() && table_list->belong_to_view)
+ if (thd->is_error())
{
- TABLE_LIST *view= table_list->belong_to_view;
- thd->clear_error();
- my_error(ER_VIEW_INVALID, MYF(0),
- view->view_db.str, view->view_name.str);
+ if (table_list->parent_l)
+ {
+ thd->clear_error();
+ my_error(ER_WRONG_MRG_TABLE, MYF(0));
+ }
+ else if (table_list->belong_to_view)
+ {
+ TABLE_LIST *view= table_list->belong_to_view;
+ thd->clear_error();
+ my_error(ER_VIEW_INVALID, MYF(0),
+ view->view_db.str, view->view_name.str);
+ }
}
DBUG_RETURN(0);
}
@@ -3731,6 +3739,20 @@ void assign_new_table_id(TABLE_SHARE *share)
DBUG_VOID_RETURN;
}
+#ifndef DBUG_OFF
+/* Cause a spurious statement reprepare for debug purposes. */
+static bool inject_reprepare(THD *thd)
+{
+ if (thd->m_reprepare_observer && thd->stmt_arena->is_reprepared == FALSE)
+ {
+ thd->m_reprepare_observer->report_error(thd);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+#endif
+
/**
Compare metadata versions of an element obtained from the table
definition cache and its corresponding node in the parse tree.
@@ -3784,13 +3806,7 @@ check_and_update_table_version(THD *thd,
tables->set_table_ref_id(table_share);
}
- DBUG_EXECUTE_IF("reprepare_each_statement",
- if (thd->m_reprepare_observer &&
- thd->stmt_arena->is_reprepared == FALSE)
- {
- thd->m_reprepare_observer->report_error(thd);
- return TRUE;
- });
+ DBUG_EXECUTE_IF("reprepare_each_statement", return inject_reprepare(thd););
return FALSE;
}
@@ -4365,6 +4381,38 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last,
/*
+ Return a appropriate read lock type given a table object.
+
+ @param thd Thread context
+ @param table TABLE object for table to be locked
+
+ @remark Due to a statement-based replication limitation, statements such as
+ INSERT INTO .. SELECT FROM .. and CREATE TABLE .. SELECT FROM need
+ to grab a TL_READ_NO_INSERT lock on the source table in order to
+ prevent the replication of a concurrent statement that modifies the
+ source table. If such a statement gets applied on the slave before
+ the INSERT .. SELECT statement finishes, data on the master could
+ differ from data on the slave and end-up with a discrepancy between
+ the binary log and table state. Furthermore, this does not apply to
+ I_S and log tables as it's always unsafe to replicate such tables
+ under statement-based replication as the table on the slave might
+ contain other data (ie: general_log is enabled on the slave). The
+ statement will be marked as unsafe for SBR in decide_logging_format().
+*/
+
+thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table)
+{
+ bool log_on= mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG);
+ ulong binlog_format= thd->variables.binlog_format;
+ if ((log_on == FALSE) || (binlog_format == BINLOG_FORMAT_ROW) ||
+ (table->s->table_category == TABLE_CATEGORY_PERFORMANCE))
+ return TL_READ;
+ else
+ return TL_READ_NO_INSERT;
+}
+
+
+/*
Open all tables in list
SYNOPSIS
@@ -4638,6 +4686,9 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
{
if (tables->lock_type == TL_WRITE_DEFAULT)
tables->table->reginfo.lock_type= thd->update_lock_default;
+ else if (tables->lock_type == TL_READ_DEFAULT)
+ tables->table->reginfo.lock_type=
+ read_lock_type_for_table(thd, tables->table);
else if (tables->table->s->tmp_table == NO_TMP_TABLE)
tables->table->reginfo.lock_type= tables->lock_type;
}
@@ -5045,7 +5096,11 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables)
void* prev_ht= NULL;
for (TABLE_LIST *table= tables; table; table= table->next_global)
{
- if (!table->placeholder() && table->lock_type >= TL_WRITE_ALLOW_WRITE)
+ if (table->placeholder())
+ continue;
+ if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE)
+ thd->lex->set_stmt_unsafe();
+ if (table->lock_type >= TL_WRITE_ALLOW_WRITE)
{
ulonglong const flags= table->table->file->ha_table_flags();
DBUG_PRINT("info", ("table: %s; ha_table_flags: %s%s",
@@ -5709,8 +5764,21 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
{
/* This is a base table. */
DBUG_ASSERT(nj_col->view_field == NULL);
- DBUG_ASSERT(nj_col->table_ref->table == nj_col->table_field->table);
- found_field= nj_col->table_field;
+ /*
+ This fix_fields is not necessary (initially this item is fixed by
+ the Item_field constructor; after reopen_tables the Item_func_eq
+ calls fix_fields on that item), it's just a check during table
+ reopening for columns that was dropped by the concurrent connection.
+ */
+ if (!nj_col->table_field->fixed &&
+ nj_col->table_field->fix_fields(thd, (Item **)&nj_col->table_field))
+ {
+ DBUG_PRINT("info", ("column '%s' was dropped by the concurrent connection",
+ nj_col->table_field->name));
+ DBUG_RETURN(NULL);
+ }
+ DBUG_ASSERT(nj_col->table_ref->table == nj_col->table_field->field->table);
+ found_field= nj_col->table_field->field;
update_field_dependencies(thd, found_field, nj_col->table_ref->table);
}
@@ -6635,7 +6703,7 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
const char *field_name_1;
/* true if field_name_1 is a member of using_fields */
bool is_using_column_1;
- if (!(nj_col_1= it_1.get_or_create_column_ref(leaf_1)))
+ if (!(nj_col_1= it_1.get_or_create_column_ref(thd, leaf_1)))
goto err;
field_name_1= nj_col_1->name();
is_using_column_1= using_fields &&
@@ -6656,7 +6724,7 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
{
Natural_join_column *cur_nj_col_2;
const char *cur_field_name_2;
- if (!(cur_nj_col_2= it_2.get_or_create_column_ref(leaf_2)))
+ if (!(cur_nj_col_2= it_2.get_or_create_column_ref(thd, leaf_2)))
goto err;
cur_field_name_2= cur_nj_col_2->name();
DBUG_PRINT ("info", ("cur_field_name_2=%s.%s",
@@ -7146,15 +7214,24 @@ static bool setup_natural_join_row_types(THD *thd,
TABLE_LIST *left_neighbor;
/* Table reference to the right of the current. */
TABLE_LIST *right_neighbor= NULL;
+ bool save_first_natural_join_processing=
+ context->select_lex->first_natural_join_processing;
+
+ context->select_lex->first_natural_join_processing= FALSE;
/* Note that tables in the list are in reversed order */
for (left_neighbor= table_ref_it++; left_neighbor ; )
{
table_ref= left_neighbor;
left_neighbor= table_ref_it++;
- /* For stored procedures do not redo work if already done. */
- if (context->select_lex->first_execution)
+ /*
+ Do not redo work if already done:
+ 1) for stored procedures,
+ 2) for multitable update after lock failure and table reopening.
+ */
+ if (save_first_natural_join_processing)
{
+ context->select_lex->first_natural_join_processing= FALSE;
if (store_top_level_join_columns(thd, table_ref,
left_neighbor, right_neighbor))
return TRUE;
@@ -7299,6 +7376,22 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
if (ref_pointer_array)
bzero(ref_pointer_array, sizeof(Item *) * fields.elements);
+ /*
+ We call set_entry() there (before fix_fields() of the whole list of field
+ items) because:
+ 1) the list of field items has same order as in the query, and the
+ Item_func_get_user_var item may go before the Item_func_set_user_var:
+ SELECT @a, @a := 10 FROM t;
+ 2) The entry->update_query_id value controls constantness of
+ Item_func_get_user_var items, so in presence of Item_func_set_user_var
+ items we have to refresh their entries before fixing of
+ Item_func_get_user_var items.
+ */
+ List_iterator<Item_func_set_user_var> li(thd->lex->set_var_list);
+ Item_func_set_user_var *var;
+ while ((var= li++))
+ var->set_entry(thd, FALSE);
+
Item **ref= ref_pointer_array;
thd->lex->current_select->cur_pos_in_select_list= 0;
while ((item= it++))
@@ -7680,6 +7773,10 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
if (!(item= field_iterator.create_item(thd)))
DBUG_RETURN(TRUE);
+ DBUG_ASSERT(item->fixed);
+ /* cache the table for the Item_fields inserted by expanding stars */
+ if (item->type() == Item::FIELD_ITEM && tables->cacheable_table)
+ ((Item_field *)item)->cached_table= tables;
if (!found)
{
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index f82cad27207..1748a737b07 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1548,10 +1548,9 @@ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
for (; tables_used; tables_used= tables_used->next_local)
{
thd_proc_info(thd, "invalidating query cache entries (table)");
- if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) &&
+ if (tables_used->lock_type >= TL_WRITE_ALLOW_WRITE &&
tables_used->table)
{
- THD *thd= current_thd;
invalidate_table(thd, tables_used->table);
}
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 9a450f245be..6d74372fd02 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -309,20 +309,25 @@ void thd_inc_row_count(THD *thd)
thd->row_count++;
}
-/*
+
+/**
Dumps a text description of a thread, its security context
(user, host) and the current query.
- SYNOPSIS
- thd_security_context()
- thd current thread context
- buffer pointer to preferred result buffer
- length length of buffer
- max_query_len how many chars of query to copy (0 for all)
-
- RETURN VALUES
- pointer to string
+ @param thd current thread context
+ @param buffer pointer to preferred result buffer
+ @param length length of buffer
+ @param max_query_len how many chars of query to copy (0 for all)
+
+ @req LOCK_thread_count
+
+ @note LOCK_thread_count mutex is not necessary when the function is invoked on
+ the currently running thread (current_thd) or if the caller in some other
+ way guarantees that access to thd->query is serialized.
+
+ @return Pointer to string
*/
+
extern "C"
char *thd_security_context(THD *thd, char *buffer, unsigned int length,
unsigned int max_query_len)
@@ -331,6 +336,16 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
const Security_context *sctx= &thd->main_security_ctx;
char header[64];
int len;
+ /*
+ The pointers thd->query and thd->proc_info might change since they are
+ being modified concurrently. This is acceptable for proc_info since its
+ values doesn't have to very accurate and the memory it points to is static,
+ but we need to attempt a snapshot on the pointer values to avoid using NULL
+ values. The pointer to thd->query however, doesn't point to static memory
+ and has to be protected by LOCK_thread_count or risk pointing to
+ uninitialized memory.
+ */
+ const char *proc_info= thd->proc_info;
len= my_snprintf(header, sizeof(header),
"MySQL thread id %lu, query id %lu",
@@ -356,10 +371,10 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
str.append(sctx->user);
}
- if (thd->proc_info)
+ if (proc_info)
{
str.append(' ');
- str.append(thd->proc_info);
+ str.append(proc_info);
}
if (thd->query)
@@ -1492,6 +1507,12 @@ sql_exchange::sql_exchange(char *name,bool flag)
cs= NULL;
}
+bool sql_exchange::escaped_given(void)
+{
+ return escaped != &default_escaped;
+}
+
+
bool select_send::send_fields(List<Item> &list, uint flags)
{
bool res;
@@ -1777,8 +1798,11 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
exchange->line_term=exchange->field_term; // Use this if it exists
field_sep_char= (exchange->enclosed->length() ?
(int) (uchar) (*exchange->enclosed)[0] : field_term_char);
- escape_char= (exchange->escaped->length() ?
- (int) (uchar) (*exchange->escaped)[0] : -1);
+ if (exchange->escaped->length() && (exchange->escaped_given() ||
+ !(thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)))
+ escape_char= (int) (uchar) (*exchange->escaped)[0];
+ else
+ escape_char= -1;
is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char));
is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char));
line_sep_char= (exchange->line_term->length() ?
@@ -2854,7 +2878,10 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
extern "C" int thd_binlog_format(const MYSQL_THD thd)
{
- return (int) thd->variables.binlog_format;
+ if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
+ return (int) thd->variables.binlog_format;
+ else
+ return BINLOG_FORMAT_UNSPEC;
}
extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all)
@@ -3451,7 +3478,7 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans,
int THD::binlog_remove_pending_rows_event(bool clear_maps)
{
- DBUG_ENTER(__FUNCTION__);
+ DBUG_ENTER("THD::binlog_remove_pending_rows_event");
if (!mysql_bin_log.is_open())
DBUG_RETURN(0);
@@ -3496,6 +3523,29 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end)
}
+#if !defined(DBUG_OFF) && !defined(_lint)
+static const char *
+show_query_type(THD::enum_binlog_query_type qtype)
+{
+ switch (qtype) {
+ case THD::ROW_QUERY_TYPE:
+ return "ROW";
+ case THD::STMT_QUERY_TYPE:
+ return "STMT";
+ case THD::MYSQL_QUERY_TYPE:
+ return "MYSQL";
+ case THD::QUERY_TYPE_COUNT:
+ default:
+ DBUG_ASSERT(0 <= qtype && qtype < THD::QUERY_TYPE_COUNT);
+ }
+
+ static char buf[64];
+ sprintf(buf, "UNKNOWN#%d", qtype);
+ return buf;
+}
+#endif
+
+
/*
Member function that will log query, either row-based or
statement-based depending on the value of the 'current_stmt_binlog_row_based'
@@ -3524,7 +3574,8 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
THD::killed_state killed_status_arg)
{
DBUG_ENTER("THD::binlog_query");
- DBUG_PRINT("enter", ("qtype: %d query: '%s'", qtype, query_arg));
+ DBUG_PRINT("enter", ("qtype: %s query: '%s'",
+ show_query_type(qtype), query_arg));
DBUG_ASSERT(query_arg && mysql_bin_log.is_open());
/*
@@ -3563,6 +3614,9 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
switch (qtype) {
case THD::ROW_QUERY_TYPE:
+ DBUG_PRINT("debug",
+ ("current_stmt_binlog_row_based: %d",
+ current_stmt_binlog_row_based));
if (current_stmt_binlog_row_based)
DBUG_RETURN(0);
/* Otherwise, we fall through */
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 8bf3e2390ea..ddaa62bd159 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -745,7 +745,7 @@ struct st_savepoint {
Ha_trx_info *ha_list;
};
-enum xa_states {XA_NOTR=0, XA_ACTIVE, XA_IDLE, XA_PREPARED};
+enum xa_states {XA_NOTR=0, XA_ACTIVE, XA_IDLE, XA_PREPARED, XA_ROLLBACK_ONLY};
extern const char *xa_state_names[];
typedef struct st_xid_state {
@@ -753,6 +753,8 @@ typedef struct st_xid_state {
XID xid; // transaction identifier
enum xa_states xa_state; // used by external XA only
bool in_thd;
+ /* Error reported by the Resource Manager (RM) to the Transaction Manager. */
+ uint rm_error;
} XID_STATE;
extern pthread_mutex_t LOCK_xid_cache;
@@ -1002,6 +1004,22 @@ enum enum_thread_type
SYSTEM_THREAD_EVENT_WORKER= 32
};
+inline char const *
+show_system_thread(enum_thread_type thread)
+{
+#define RETURN_NAME_AS_STRING(NAME) case (NAME): return #NAME
+ switch (thread) {
+ RETURN_NAME_AS_STRING(NON_SYSTEM_THREAD);
+ RETURN_NAME_AS_STRING(SYSTEM_THREAD_DELAYED_INSERT);
+ RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_IO);
+ RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_SQL);
+ RETURN_NAME_AS_STRING(SYSTEM_THREAD_NDBCLUSTER_BINLOG);
+ RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_SCHEDULER);
+ RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_WORKER);
+ }
+#undef RETURN_NAME_AS_STRING
+ return "UNKNOWN"; /* keep gcc happy */
+}
/**
This class represents the interface for internal error handlers.
@@ -1531,6 +1549,9 @@ public:
then the latter INSERT will insert no rows
(first_successful_insert_id_in_cur_stmt == 0), but storing "INSERT_ID=3"
in the binlog is still needed; the list's minimum will contain 3.
+ This variable is cumulative: if several statements are written to binlog
+ as one (stored functions or triggers are used) this list is the
+ concatenation of all intervals reserved by all statements.
*/
Discrete_intervals_list auto_inc_intervals_in_cur_stmt_for_binlog;
/* Used by replication and SET INSERT_ID */
@@ -2096,6 +2117,10 @@ public:
Don't reset binlog format for NDB binlog injector thread.
*/
+ DBUG_PRINT("debug",
+ ("temporary_tables: %p, in_sub_stmt: %d, system_thread: %s",
+ temporary_tables, in_sub_stmt,
+ show_system_thread(system_thread)));
if ((temporary_tables == NULL) && (in_sub_stmt == 0) &&
(system_thread != SYSTEM_THREAD_NDBCLUSTER_BINLOG))
{
@@ -2257,6 +2282,7 @@ public:
ulong skip_lines;
CHARSET_INFO *cs;
sql_exchange(char *name,bool dumpfile_flag);
+ bool escaped_given(void);
};
#include "log_event.h"
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index e1bff5e435b..0db88d7dd90 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -37,7 +37,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp,
const char *db, const char *path, uint level,
TABLE_LIST **dropped_tables);
-static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path);
+long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path);
static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error);
static void mysql_change_db_impl(THD *thd,
LEX_STRING *new_db_name,
@@ -1096,7 +1096,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
else if (file->name[0] == 'a' && file->name[1] == 'r' &&
file->name[2] == 'c' && file->name[3] == '\0')
{
- /* .frm archive */
+ /* .frm archive:
+ Those archives are obsolete, but following code should
+ exist to remove existent "arc" directories.
+ See #ifdef FRM_ARCHIVE directives for obsolete code.
+ */
char newpath[FN_REFLEN];
MY_DIR *new_dirp;
strxmov(newpath, org_path, "/", "arc", NullS);
@@ -1260,9 +1264,13 @@ static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error)
RETURN
> 0 number of removed files
-1 error
+
+ NOTE
+ A support of "arc" directories is obsolete, however this
+ function should exist to remove existent "arc" directories.
+ See #ifdef FRM_ARCHIVE directives for obsolete code.
*/
-static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp,
- const char *org_path)
+long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path)
{
long deleted= 0;
ulong found_other_files= 0;
@@ -1304,6 +1312,7 @@ static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp,
{
goto err;
}
+ deleted++;
}
if (thd->killed)
goto err;
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 5debb3170f7..47d2d69ef35 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -398,7 +398,11 @@ cleanup:
free_underlaid_joins(thd, select_lex);
if (error < 0 || (thd->lex->ignore && !thd->is_fatal_error))
{
- thd->row_count_func= deleted;
+ /*
+ If a TRUNCATE TABLE was issued, the number of rows should be reported as
+ zero since the exact number is unknown.
+ */
+ thd->row_count_func= reset_auto_increment ? 0 : deleted;
my_ok(thd, (ha_rows) thd->row_count_func);
DBUG_PRINT("info",("%ld records deleted",(long) deleted));
}
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 0b74e3455eb..79da1936eb9 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -109,6 +109,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
DBUG_ENTER("push_warning");
DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
+ DBUG_ASSERT(code != 0);
+ DBUG_ASSERT(msg != NULL);
+
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE &&
!(thd->options & OPTION_SQL_NOTES))
DBUG_RETURN(0);
@@ -177,7 +180,10 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
char warning[ERRMSGSIZE+20];
DBUG_ENTER("push_warning_printf");
DBUG_PRINT("enter",("warning: %u", code));
-
+
+ DBUG_ASSERT(code != 0);
+ DBUG_ASSERT(format != NULL);
+
va_start(args,format);
my_vsnprintf(warning, sizeof(warning), format, args);
va_end(args);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index a275c680cb5..947546c4429 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -833,7 +833,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
info.copied=values_list.elements;
end_delayed_insert(thd);
}
- query_cache_invalidate3(thd, table_list, 1);
}
else
#endif
@@ -1548,6 +1547,17 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
}
}
}
+
+ /*
+ If more than one iteration of the above while loop is done, from the second
+ one the row being inserted will have an explicit value in the autoinc field,
+ which was set at the first call of handler::update_auto_increment(). This
+ value is saved to avoid thd->insert_id_for_cur_row becoming 0. Use this saved
+ autoinc value.
+ */
+ if (table->file->insert_id_for_cur_row == 0)
+ table->file->insert_id_for_cur_row= insert_id_for_cur_row;
+
thd->record_first_successful_insert_id_in_cur_stmt(table->file->insert_id_for_cur_row);
/*
Restore column maps if they where replaced during an duplicate key
@@ -2535,8 +2545,13 @@ bool Delayed_insert::handle_inserts(void)
thd_proc_info(&thd, "upgrading lock");
if (thr_upgrade_write_delay_lock(*thd.lock->locks))
{
- /* This can only happen if thread is killed by shutdown */
- sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->s->table_name.str);
+ /*
+ This can happen if thread is killed either by a shutdown
+ or if another thread is removing the current table definition
+ from the table cache.
+ */
+ my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
+ table->s->table_name.str);
goto err;
}
@@ -2691,9 +2706,10 @@ bool Delayed_insert::handle_inserts(void)
query_cache_invalidate3(&thd, table, 1);
if (thr_reschedule_write_lock(*thd.lock->locks))
{
- /* This should never happen */
- sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),
- table->s->table_name.str);
+ /* This is not known to happen. */
+ my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
+ table->s->table_name.str);
+ goto err;
}
if (!using_bin_log)
table->file->extra(HA_EXTRA_WRITE_CACHE);
@@ -2740,6 +2756,11 @@ bool Delayed_insert::handle_inserts(void)
/* Remove all not used rows */
while ((row=rows.get()))
{
+ if (table->s->blob_fields)
+ {
+ memcpy(table->record[0],row->record,table->s->reclength);
+ free_delayed_insert_blobs(table);
+ }
delete row;
thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);
stacked_inserts--;
@@ -3621,7 +3642,8 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
tmp_table_list.table = *tables;
query.length(0); // Have to zero it since constructor doesn't
- result= store_create_info(thd, &tmp_table_list, &query, create_info);
+ result= store_create_info(thd, &tmp_table_list, &query, create_info,
+ /* show_database */ TRUE);
DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */
if (mysql_bin_log.is_open())
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 1822176f00a..983d53a041d 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -293,6 +293,7 @@ void lex_start(THD *thd)
lex->select_lex.init_query();
lex->value_list.empty();
lex->update_list.empty();
+ lex->set_var_list.empty();
lex->param_list.empty();
lex->view_list.empty();
lex->prepared_stmt_params.empty();
@@ -1552,6 +1553,7 @@ void st_select_lex::init_query()
subquery_in_having= explicit_limit= 0;
is_item_list_lookup= 0;
first_execution= 1;
+ first_natural_join_processing= 1;
first_cond_optimization= 1;
parsing_place= NO_MATTER;
exclude_from_table_unique_test= no_wrap_view_item= FALSE;
@@ -2395,15 +2397,20 @@ void st_select_lex_unit::set_limit(st_select_lex *sl)
val= sl->select_limit ? sl->select_limit->val_uint() : HA_POS_ERROR;
select_limit_val= (ha_rows)val;
#ifndef BIG_TABLES
- /*
+ /*
Check for overflow : ha_rows can be smaller then ulonglong if
BIG_TABLES is off.
*/
if (val != (ulonglong)select_limit_val)
select_limit_val= HA_POS_ERROR;
#endif
- offset_limit_cnt= (ha_rows)(sl->offset_limit ? sl->offset_limit->val_uint() :
- ULL(0));
+ val= sl->offset_limit ? sl->offset_limit->val_uint() : ULL(0);
+ offset_limit_cnt= (ha_rows)val;
+#ifndef BIG_TABLES
+ /* Check for truncation. */
+ if (val != (ulonglong)offset_limit_cnt)
+ offset_limit_cnt= HA_POS_ERROR;
+#endif
select_limit_cnt= select_limit_val + offset_limit_cnt;
if (select_limit_cnt < select_limit_val)
select_limit_cnt= HA_POS_ERROR; // no limit
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index bb3dc00fc8d..24731b600e9 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -667,6 +667,7 @@ public:
case of an error during prepare the PS is not created.
*/
bool first_execution;
+ bool first_natural_join_processing;
bool first_cond_optimization;
/* do not wrap view fields with Item_ref */
bool no_wrap_view_item;
@@ -842,15 +843,12 @@ inline bool st_select_lex_unit::is_union ()
#define ALTER_COALESCE_PARTITION (1L << 15)
#define ALTER_REORGANIZE_PARTITION (1L << 16)
#define ALTER_PARTITION (1L << 17)
-#define ALTER_OPTIMIZE_PARTITION (1L << 18)
+#define ALTER_ADMIN_PARTITION (1L << 18)
#define ALTER_TABLE_REORG (1L << 19)
#define ALTER_REBUILD_PARTITION (1L << 20)
#define ALTER_ALL_PARTITION (1L << 21)
-#define ALTER_ANALYZE_PARTITION (1L << 22)
-#define ALTER_CHECK_PARTITION (1L << 23)
-#define ALTER_REPAIR_PARTITION (1L << 24)
-#define ALTER_REMOVE_PARTITIONING (1L << 25)
-#define ALTER_FOREIGN_KEY (1L << 26)
+#define ALTER_REMOVE_PARTITIONING (1L << 22)
+#define ALTER_FOREIGN_KEY (1L << 23)
enum enum_alter_table_change_level
{
@@ -1549,6 +1547,7 @@ typedef struct st_lex : public Query_tables_list
List<Item> *insert_list,field_list,value_list,update_list;
List<List_item> many_values;
List<set_var_base> var_list;
+ List<Item_func_set_user_var> set_var_list; // in-query assignment list
List<Item_param> param_list;
List<LEX_STRING> view_list; // view list (list of field names in view)
/*
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 49015fb3e2a..cae8f682a09 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -327,7 +327,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
bzero((char*) &info,sizeof(info));
info.ignore= ignore;
info.handle_duplicates=handle_duplicates;
- info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX;
+ info.escape_char= (escaped->length() && (ex->escaped_given() ||
+ !(thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)))
+ ? (*escaped)[0] : INT_MAX;
READ_INFO read_info(file,tot_length,
ex->cs ? ex->cs : thd->variables.collation_database,
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 819c9b9ed26..1391e6bc827 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -87,9 +87,57 @@ const LEX_STRING command_name[]={
};
const char *xa_state_names[]={
- "NON-EXISTING", "ACTIVE", "IDLE", "PREPARED"
+ "NON-EXISTING", "ACTIVE", "IDLE", "PREPARED", "ROLLBACK ONLY"
};
+/**
+ Mark a XA transaction as rollback-only if the RM unilaterally
+ rolled back the transaction branch.
+
+ @note If a rollback was requested by the RM, this function sets
+ the appropriate rollback error code and transits the state
+ to XA_ROLLBACK_ONLY.
+
+ @return TRUE if transaction was rolled back or if the transaction
+ state is XA_ROLLBACK_ONLY. FALSE otherwise.
+*/
+static bool xa_trans_rolled_back(XID_STATE *xid_state)
+{
+ if (xid_state->rm_error)
+ {
+ switch (xid_state->rm_error) {
+ case ER_LOCK_WAIT_TIMEOUT:
+ my_error(ER_XA_RBTIMEOUT, MYF(0));
+ break;
+ case ER_LOCK_DEADLOCK:
+ my_error(ER_XA_RBDEADLOCK, MYF(0));
+ break;
+ default:
+ my_error(ER_XA_RBROLLBACK, MYF(0));
+ }
+ xid_state->xa_state= XA_ROLLBACK_ONLY;
+ }
+
+ return (xid_state->xa_state == XA_ROLLBACK_ONLY);
+}
+
+/**
+ Rollback work done on behalf of at ransaction branch.
+*/
+static bool xa_trans_rollback(THD *thd)
+{
+ bool status= test(ha_rollback(thd));
+
+ thd->options&= ~(ulong) OPTION_BEGIN;
+ thd->transaction.all.modified_non_trans_table= FALSE;
+ thd->server_status&= ~SERVER_STATUS_IN_TRANS;
+ xid_cache_delete(&thd->transaction.xid_state);
+ thd->transaction.xid_state.xa_state= XA_NOTR;
+ thd->transaction.xid_state.rm_error= 0;
+
+ return status;
+}
+
static void unlock_locked_tables(THD *thd)
{
if (thd->locked_tables)
@@ -2344,8 +2392,8 @@ mysql_execute_command(THD *thd)
}
else
{
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "the master info structure does not exist");
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO));
my_ok(thd);
}
pthread_mutex_unlock(&LOCK_active_mi);
@@ -2744,11 +2792,13 @@ end_with_restore_list:
/* Don't yet allow changing of symlinks with ALTER TABLE */
if (create_info.data_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "DATA DIRECTORY option ignored");
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "DATA DIRECTORY");
if (create_info.index_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "INDEX DIRECTORY option ignored");
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "INDEX DIRECTORY");
create_info.data_file_name= create_info.index_file_name= NULL;
/* ALTER TABLE ends previous transaction */
if (end_active_trans(thd))
@@ -4527,6 +4577,7 @@ create_sp_error:
}
DBUG_ASSERT(thd->transaction.xid_state.xid.is_null());
thd->transaction.xid_state.xa_state=XA_ACTIVE;
+ thd->transaction.xid_state.rm_error= 0;
thd->transaction.xid_state.xid.set(thd->lex->xid);
xid_cache_insert(&thd->transaction.xid_state);
thd->transaction.all.modified_non_trans_table= FALSE;
@@ -4552,6 +4603,8 @@ create_sp_error:
my_error(ER_XAER_NOTA, MYF(0));
break;
}
+ if (xa_trans_rolled_back(&thd->transaction.xid_state))
+ break;
thd->transaction.xid_state.xa_state=XA_IDLE;
my_ok(thd);
break;
@@ -4583,6 +4636,12 @@ create_sp_error:
XID_STATE *xs=xid_cache_search(thd->lex->xid);
if (!xs || xs->in_thd)
my_error(ER_XAER_NOTA, MYF(0));
+ else if (xa_trans_rolled_back(xs))
+ {
+ ha_commit_or_rollback_by_xid(thd->lex->xid, 0);
+ xid_cache_delete(xs);
+ break;
+ }
else
{
ha_commit_or_rollback_by_xid(thd->lex->xid, 1);
@@ -4591,6 +4650,11 @@ create_sp_error:
}
break;
}
+ if (xa_trans_rolled_back(&thd->transaction.xid_state))
+ {
+ xa_trans_rollback(thd);
+ break;
+ }
if (thd->transaction.xid_state.xa_state == XA_IDLE &&
thd->lex->xa_opt == XA_ONE_PHASE)
{
@@ -4637,28 +4701,26 @@ create_sp_error:
my_error(ER_XAER_NOTA, MYF(0));
else
{
+ bool ok= !xa_trans_rolled_back(xs);
ha_commit_or_rollback_by_xid(thd->lex->xid, 0);
xid_cache_delete(xs);
- my_ok(thd);
+ if (ok)
+ my_ok(thd);
}
break;
}
if (thd->transaction.xid_state.xa_state != XA_IDLE &&
- thd->transaction.xid_state.xa_state != XA_PREPARED)
+ thd->transaction.xid_state.xa_state != XA_PREPARED &&
+ thd->transaction.xid_state.xa_state != XA_ROLLBACK_ONLY)
{
my_error(ER_XAER_RMFAIL, MYF(0),
xa_state_names[thd->transaction.xid_state.xa_state]);
break;
}
- if (ha_rollback(thd))
+ if (xa_trans_rollback(thd))
my_error(ER_XAER_RMERR, MYF(0));
else
my_ok(thd);
- thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->transaction.all.modified_non_trans_table= FALSE;
- thd->server_status&= ~SERVER_STATUS_IN_TRANS;
- xid_cache_delete(&thd->transaction.xid_state);
- thd->transaction.xid_state.xa_state=XA_NOTR;
break;
case SQLCOM_XA_RECOVER:
res= mysql_xa_recover(thd);
@@ -5510,6 +5572,10 @@ void mysql_reset_thd_for_next_command(THD *thd)
*/
thd->reset_current_stmt_binlog_row_based();
+ DBUG_PRINT("debug",
+ ("current_stmt_binlog_row_based: %d",
+ thd->current_stmt_binlog_row_based));
+
DBUG_VOID_RETURN;
}
@@ -5650,7 +5716,7 @@ void mysql_init_multi_delete(LEX *lex)
lex->select_lex.select_limit= 0;
lex->unit.select_limit_cnt= HA_POS_ERROR;
lex->select_lex.table_list.save_and_clear(&lex->auxiliary_table_list);
- lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
+ lex->lock_option= TL_READ_DEFAULT;
lex->query_tables= 0;
lex->query_tables_last= &lex->query_tables;
}
@@ -7530,6 +7596,39 @@ int test_if_data_home_dir(const char *dir)
C_MODE_END
+/**
+ Check that host name string is valid.
+
+ @param[in] str string to be checked
+
+ @return Operation status
+ @retval FALSE host name is ok
+ @retval TRUE host name string is longer than max_length or
+ has invalid symbols
+*/
+
+bool check_host_name(LEX_STRING *str)
+{
+ const char *name= str->str;
+ const char *end= str->str + str->length;
+ if (check_string_byte_length(str, ER(ER_HOSTNAME), HOSTNAME_LENGTH))
+ return TRUE;
+
+ while (name != end)
+ {
+ if (*name == '@')
+ {
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "Malformed hostname (illegal symbol: '%c')", MYF(0),
+ *name);
+ return TRUE;
+ }
+ name++;
+ }
+ return FALSE;
+}
+
+
extern int MYSQLparse(void *thd); // from sql_yacc.cc
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 6419d336b9f..5ed64ea8fd5 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -73,10 +73,8 @@ static int get_part_id_charset_func_subpart(partition_info *part_info,
static int get_part_part_id_charset_func(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
-static uint32 get_subpart_id_charset_func(partition_info *part_info);
-int get_partition_id_list(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
+static int get_subpart_id_charset_func(partition_info *part_info,
+ uint32 *part_id);
int get_partition_id_list(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
@@ -119,10 +117,14 @@ int get_partition_id_list_sub_linear_hash(partition_info *part_info,
int get_partition_id_list_sub_linear_key(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
-uint32 get_partition_id_hash_sub(partition_info *part_info);
-uint32 get_partition_id_key_sub(partition_info *part_info);
-uint32 get_partition_id_linear_hash_sub(partition_info *part_info);
-uint32 get_partition_id_linear_key_sub(partition_info *part_info);
+int get_partition_id_hash_sub(partition_info *part_info,
+ uint32 *part_id);
+int get_partition_id_key_sub(partition_info *part_info,
+ uint32 *part_id);
+int get_partition_id_linear_hash_sub(partition_info *part_info,
+ uint32 *part_id);
+int get_partition_id_linear_key_sub(partition_info *part_info,
+ uint32 *part_id);
static uint32 get_next_partition_via_walking(PARTITION_ITERATOR*);
static void set_up_range_analysis_info(partition_info *part_info);
static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR*);
@@ -2076,16 +2078,16 @@ char *generate_partition_syntax(partition_info *part_info,
err+= add_string_len(fptr, part_info->part_func_string,
part_info->part_func_len);
err+= add_end_parenthesis(fptr);
- err+= add_space(fptr);
if ((!part_info->use_default_no_partitions) &&
part_info->use_default_partitions)
{
+ err+= add_string(fptr, "\n");
err+= add_string(fptr, "PARTITIONS ");
err+= add_int(fptr, part_info->no_parts);
- err+= add_space(fptr);
}
if (part_info->is_sub_partitioned())
{
+ err+= add_string(fptr, "\n");
err+= add_subpartition_by(fptr);
/* Must be hash partitioning for subpartitioning */
if (part_info->linear_hash_ind)
@@ -2098,13 +2100,12 @@ char *generate_partition_syntax(partition_info *part_info,
err+= add_string_len(fptr, part_info->subpart_func_string,
part_info->subpart_func_len);
err+= add_end_parenthesis(fptr);
- err+= add_space(fptr);
if ((!part_info->use_default_no_subpartitions) &&
part_info->use_default_subpartitions)
{
+ err+= add_string(fptr, "\n");
err+= add_string(fptr, "SUBPARTITIONS ");
err+= add_int(fptr, part_info->no_subparts);
- err+= add_space(fptr);
}
}
tot_no_parts= part_info->partitions.elements;
@@ -2113,6 +2114,7 @@ char *generate_partition_syntax(partition_info *part_info,
if (!part_info->use_default_partitions)
{
bool first= TRUE;
+ err+= add_string(fptr, "\n");
err+= add_begin_parenthesis(fptr);
i= 0;
do
@@ -2124,6 +2126,7 @@ char *generate_partition_syntax(partition_info *part_info,
if (!first)
{
err+= add_comma(fptr);
+ err+= add_string(fptr, "\n");
err+= add_space(fptr);
}
first= FALSE;
@@ -2138,6 +2141,7 @@ char *generate_partition_syntax(partition_info *part_info,
}
else
{
+ err+= add_string(fptr, "\n");
err+= add_space(fptr);
err+= add_begin_parenthesis(fptr);
List_iterator<partition_element> sub_it(part_elem->subpartitions);
@@ -2152,6 +2156,8 @@ char *generate_partition_syntax(partition_info *part_info,
if (j != (no_subparts-1))
{
err+= add_comma(fptr);
+ err+= add_string(fptr, "\n");
+ err+= add_space(fptr);
err+= add_space(fptr);
}
else
@@ -2232,17 +2238,24 @@ bool partition_key_modified(TABLE *table, const MY_BITMAP *fields)
SYNOPSIS
part_val_int()
item_expr The item expression to evaluate
+ out:result The value of the partition function,
+ LONGLONG_MIN if any null value in function
RETURN VALUES
- The value of the partition function, LONGLONG_MIN if any null value
- in function
+ TRUE Error in val_int()
+ FALSE ok
*/
-static inline longlong part_val_int(Item *item_expr)
+static inline int part_val_int(Item *item_expr, longlong *result)
{
- longlong value= item_expr->val_int();
+ *result= item_expr->val_int();
if (item_expr->null_value)
- value= LONGLONG_MIN;
- return value;
+ {
+ if (current_thd->is_error())
+ return TRUE;
+ else
+ *result= LONGLONG_MIN;
+ }
+ return FALSE;
}
@@ -2319,24 +2332,29 @@ static uint32 get_part_id_for_sub(uint32 loc_part_id, uint32 sub_part_id,
get_part_id_hash()
no_parts Number of hash partitions
part_expr Item tree of hash function
- out:func_value Value of hash function
+ out:part_id The returned partition id
+ out:func_value Value of hash function
RETURN VALUE
- Calculated partition id
+ != 0 Error code
+ FALSE Success
*/
-inline
-static uint32 get_part_id_hash(uint no_parts,
- Item *part_expr,
- longlong *func_value)
+static int get_part_id_hash(uint no_parts,
+ Item *part_expr,
+ uint32 *part_id,
+ longlong *func_value)
{
longlong int_hash_id;
DBUG_ENTER("get_part_id_hash");
- *func_value= part_val_int(part_expr);
+ if (part_val_int(part_expr, func_value))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
int_hash_id= *func_value % no_parts;
- DBUG_RETURN(int_hash_id < 0 ? (uint32) -int_hash_id : (uint32) int_hash_id);
+ *part_id= int_hash_id < 0 ? (uint32) -int_hash_id : (uint32) int_hash_id;
+ DBUG_RETURN(FALSE);
}
@@ -2349,24 +2367,29 @@ static uint32 get_part_id_hash(uint no_parts,
desired information is given
no_parts Number of hash partitions
part_expr Item tree of hash function
+ out:part_id The returned partition id
out:func_value Value of hash function
RETURN VALUE
- Calculated partition id
+ != 0 Error code
+ 0 OK
*/
-inline
-static uint32 get_part_id_linear_hash(partition_info *part_info,
- uint no_parts,
- Item *part_expr,
- longlong *func_value)
+static int get_part_id_linear_hash(partition_info *part_info,
+ uint no_parts,
+ Item *part_expr,
+ uint32 *part_id,
+ longlong *func_value)
{
DBUG_ENTER("get_part_id_linear_hash");
- *func_value= part_val_int(part_expr);
- DBUG_RETURN(get_part_id_from_linear_hash(*func_value,
- part_info->linear_hash_mask,
- no_parts));
+ if (part_val_int(part_expr, func_value))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
+ *part_id= get_part_id_from_linear_hash(*func_value,
+ part_info->linear_hash_mask,
+ no_parts);
+ DBUG_RETURN(FALSE);
}
@@ -2503,49 +2526,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
}
return;
}
-/*
- This function is used to calculate the partition id where all partition
- fields have been prepared to point to a record where the partition field
- values are bound.
-
- SYNOPSIS
- get_partition_id()
- part_info A reference to the partition_info struct where all the
- desired information is given
- out:part_id The partition id is returned through this pointer
- out: func_value Value of partition function (longlong)
-
- RETURN VALUE
- part_id Partition id of partition that would contain
- row with given values of PF-fields
- HA_ERR_NO_PARTITION_FOUND The fields of the partition function didn't
- fit into any partition and thus the values of
- the PF-fields are not allowed.
-
- DESCRIPTION
- A routine used from write_row, update_row and delete_row from any
- handler supporting partitioning. It is also a support routine for
- get_partition_set used to find the set of partitions needed to scan
- for a certain index scan or full table scan.
-
- It is actually 14 different variants of this function which are called
- through a function pointer.
- get_partition_id_list
- get_partition_id_range
- get_partition_id_hash_nosub
- get_partition_id_key_nosub
- get_partition_id_linear_hash_nosub
- get_partition_id_linear_key_nosub
- get_partition_id_range_sub_hash
- get_partition_id_range_sub_key
- get_partition_id_range_sub_linear_hash
- get_partition_id_range_sub_linear_key
- get_partition_id_list_sub_hash
- get_partition_id_list_sub_key
- get_partition_id_list_sub_linear_hash
- get_partition_id_list_sub_linear_key
-*/
/*
This function is used to calculate the main partition to use in the case of
@@ -2557,14 +2538,13 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
part_info A reference to the partition_info struct where all the
desired information is given
out:part_id The partition id is returned through this pointer
- out: func_value The value calculated by partition function
+ out:func_value The value calculated by partition function
RETURN VALUE
- part_id Partition id of partition that would contain
- row with given values of PF-fields
HA_ERR_NO_PARTITION_FOUND The fields of the partition function didn't
fit into any partition and thus the values of
the PF-fields are not allowed.
+ 0 OK
DESCRIPTION
@@ -2640,13 +2620,14 @@ static int get_part_part_id_charset_func(partition_info *part_info,
}
-static uint32 get_subpart_id_charset_func(partition_info *part_info)
+static int get_subpart_id_charset_func(partition_info *part_info,
+ uint32 *part_id)
{
int res;
copy_to_part_field_buffers(part_info->subpart_charset_field_array,
part_info->subpart_field_buffers,
part_info->restore_subpart_field_ptrs);
- res= part_info->get_subpartition_id_charset(part_info);
+ res= part_info->get_subpartition_id_charset(part_info, part_id);
restore_part_field_pointers(part_info->subpart_charset_field_array,
part_info->restore_subpart_field_ptrs);
return res;
@@ -2661,11 +2642,15 @@ int get_partition_id_list(partition_info *part_info,
int list_index;
int min_list_index= 0;
int max_list_index= part_info->no_list_values - 1;
- longlong part_func_value= part_val_int(part_info->part_expr);
+ longlong part_func_value;
+ int error= part_val_int(part_info->part_expr, &part_func_value);
longlong list_value;
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("get_partition_id_list");
+ if (error)
+ goto notfound;
+
if (part_info->part_expr->null_value)
{
if (part_info->has_null_value)
@@ -2809,10 +2794,14 @@ int get_partition_id_range(partition_info *part_info,
uint min_part_id= 0;
uint max_part_id= max_partition;
uint loc_part_id;
- longlong part_func_value= part_val_int(part_info->part_expr);
+ longlong part_func_value;
+ int error= part_val_int(part_info->part_expr, &part_func_value);
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("get_partition_id_range");
+ if (error)
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
if (part_info->part_expr->null_value)
{
*part_id= 0;
@@ -2970,9 +2959,8 @@ int get_partition_id_hash_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
- *part_id= get_part_id_hash(part_info->no_parts, part_info->part_expr,
- func_value);
- return 0;
+ return get_part_id_hash(part_info->no_parts, part_info->part_expr,
+ part_id, func_value);
}
@@ -2980,9 +2968,8 @@ int get_partition_id_linear_hash_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
- *part_id= get_part_id_linear_hash(part_info, part_info->no_parts,
- part_info->part_expr, func_value);
- return 0;
+ return get_part_id_linear_hash(part_info, part_info->no_parts,
+ part_info->part_expr, part_id, func_value);
}
@@ -3016,6 +3003,8 @@ int get_partition_id_range_sub_hash(partition_info *part_info,
longlong local_func_value;
int error;
DBUG_ENTER("get_partition_id_range_sub_hash");
+ LINT_INIT(loc_part_id);
+ LINT_INIT(sub_part_id);
if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
func_value))))
@@ -3023,8 +3012,12 @@ int get_partition_id_range_sub_hash(partition_info *part_info,
DBUG_RETURN(error);
}
no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_hash(no_subparts, part_info->subpart_expr,
- &local_func_value);
+ if (unlikely((error= get_part_id_hash(no_subparts, part_info->subpart_expr,
+ &sub_part_id, &local_func_value))))
+ {
+ DBUG_RETURN(error);
+ }
+
*part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
DBUG_RETURN(0);
}
@@ -3039,6 +3032,8 @@ int get_partition_id_range_sub_linear_hash(partition_info *part_info,
longlong local_func_value;
int error;
DBUG_ENTER("get_partition_id_range_sub_linear_hash");
+ LINT_INIT(loc_part_id);
+ LINT_INIT(sub_part_id);
if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
func_value))))
@@ -3046,9 +3041,14 @@ int get_partition_id_range_sub_linear_hash(partition_info *part_info,
DBUG_RETURN(error);
}
no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_linear_hash(part_info, no_subparts,
- part_info->subpart_expr,
- &local_func_value);
+ if (unlikely((error= get_part_id_linear_hash(part_info, no_subparts,
+ part_info->subpart_expr,
+ &sub_part_id,
+ &local_func_value))))
+ {
+ DBUG_RETURN(error);
+ }
+
*part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
DBUG_RETURN(0);
}
@@ -3063,6 +3063,7 @@ int get_partition_id_range_sub_key(partition_info *part_info,
longlong local_func_value;
int error;
DBUG_ENTER("get_partition_id_range_sub_key");
+ LINT_INIT(loc_part_id);
if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
func_value))))
@@ -3086,6 +3087,7 @@ int get_partition_id_range_sub_linear_key(partition_info *part_info,
longlong local_func_value;
int error;
DBUG_ENTER("get_partition_id_range_sub_linear_key");
+ LINT_INIT(loc_part_id);
if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
func_value))))
@@ -3110,6 +3112,7 @@ int get_partition_id_list_sub_hash(partition_info *part_info,
longlong local_func_value;
int error;
DBUG_ENTER("get_partition_id_list_sub_hash");
+ LINT_INIT(sub_part_id);
if (unlikely((error= get_partition_id_list(part_info, &loc_part_id,
func_value))))
@@ -3117,8 +3120,12 @@ int get_partition_id_list_sub_hash(partition_info *part_info,
DBUG_RETURN(error);
}
no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_hash(no_subparts, part_info->subpart_expr,
- &local_func_value);
+ if (unlikely((error= get_part_id_hash(no_subparts, part_info->subpart_expr,
+ &sub_part_id, &local_func_value))))
+ {
+ DBUG_RETURN(error);
+ }
+
*part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
DBUG_RETURN(0);
}
@@ -3133,6 +3140,7 @@ int get_partition_id_list_sub_linear_hash(partition_info *part_info,
longlong local_func_value;
int error;
DBUG_ENTER("get_partition_id_list_sub_linear_hash");
+ LINT_INIT(sub_part_id);
if (unlikely((error= get_partition_id_list(part_info, &loc_part_id,
func_value))))
@@ -3140,9 +3148,14 @@ int get_partition_id_list_sub_linear_hash(partition_info *part_info,
DBUG_RETURN(error);
}
no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_linear_hash(part_info, no_subparts,
- part_info->subpart_expr,
- &local_func_value);
+ if (unlikely((error= get_part_id_linear_hash(part_info, no_subparts,
+ part_info->subpart_expr,
+ &sub_part_id,
+ &local_func_value))))
+ {
+ DBUG_RETURN(error);
+ }
+
*part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
DBUG_RETURN(0);
}
@@ -3219,36 +3232,43 @@ int get_partition_id_list_sub_linear_key(partition_info *part_info,
get_partition_id_linear_key_sub
*/
-uint32 get_partition_id_hash_sub(partition_info *part_info)
+int get_partition_id_hash_sub(partition_info *part_info,
+ uint32 *part_id)
{
longlong func_value;
return get_part_id_hash(part_info->no_subparts, part_info->subpart_expr,
- &func_value);
+ part_id, &func_value);
}
-uint32 get_partition_id_linear_hash_sub(partition_info *part_info)
+int get_partition_id_linear_hash_sub(partition_info *part_info,
+ uint32 *part_id)
{
longlong func_value;
return get_part_id_linear_hash(part_info, part_info->no_subparts,
- part_info->subpart_expr, &func_value);
+ part_info->subpart_expr, part_id,
+ &func_value);
}
-uint32 get_partition_id_key_sub(partition_info *part_info)
+int get_partition_id_key_sub(partition_info *part_info,
+ uint32 *part_id)
{
longlong func_value;
- return get_part_id_key(part_info->subpart_field_array,
- part_info->no_subparts, &func_value);
+ *part_id= get_part_id_key(part_info->subpart_field_array,
+ part_info->no_subparts, &func_value);
+ return FALSE;
}
-uint32 get_partition_id_linear_key_sub(partition_info *part_info)
+int get_partition_id_linear_key_sub(partition_info *part_info,
+ uint32 *part_id)
{
longlong func_value;
- return get_part_id_linear_key(part_info,
- part_info->subpart_field_array,
- part_info->no_subparts, &func_value);
+ *part_id= get_part_id_linear_key(part_info,
+ part_info->subpart_field_array,
+ part_info->no_subparts, &func_value);
+ return FALSE;
}
@@ -3337,37 +3357,40 @@ static bool check_part_func_bound(Field **ptr)
buf A buffer that can be used to evaluate the partition function
key_info The index object
key_spec A key_range containing key and key length
+ out:part_id The returned partition id
RETURN VALUES
- part_id Subpartition id to use
+ TRUE All fields in partition function are set
+ FALSE Not all fields in partition function are set
DESCRIPTION
Use key buffer to set-up record in buf, move field pointers and
get the partition identity and restore field pointers afterwards.
*/
-static uint32 get_sub_part_id_from_key(const TABLE *table,uchar *buf,
- KEY *key_info,
- const key_range *key_spec)
+static int get_sub_part_id_from_key(const TABLE *table,uchar *buf,
+ KEY *key_info,
+ const key_range *key_spec,
+ uint32 *part_id)
{
uchar *rec0= table->record[0];
partition_info *part_info= table->part_info;
- uint32 part_id;
+ int res;
DBUG_ENTER("get_sub_part_id_from_key");
key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
{
- part_id= part_info->get_subpartition_id(part_info);
+ res= part_info->get_subpartition_id(part_info, part_id);
}
else
{
Field **part_field_array= part_info->subpart_field_array;
set_field_ptr(part_field_array, buf, rec0);
- part_id= part_info->get_subpartition_id(part_info);
+ res= part_info->get_subpartition_id(part_info, part_id);
set_field_ptr(part_field_array, rec0, buf);
}
- DBUG_RETURN(part_id);
+ DBUG_RETURN(res);
}
/*
@@ -3586,7 +3609,13 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
else if (part_info->is_sub_partitioned())
{
if (part_info->all_fields_in_SPF.is_set(index))
- sub_part= get_sub_part_id_from_key(table, buf, key_info, key_spec);
+ {
+ if (get_sub_part_id_from_key(table, buf, key_info, key_spec, &sub_part))
+ {
+ part_spec->start_part= no_parts;
+ DBUG_VOID_RETURN;
+ }
+ }
else if (part_info->all_fields_in_PPF.is_set(index))
{
if (get_part_id_from_key(table,buf,key_info,
@@ -3632,7 +3661,14 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
else if (part_info->is_sub_partitioned())
{
if (check_part_func_bound(part_info->subpart_field_array))
- sub_part= get_sub_part_id_from_key(table, buf, key_info, key_spec);
+ {
+ if (get_sub_part_id_from_key(table, buf, key_info, key_spec, &sub_part))
+ {
+ part_spec->start_part= no_parts;
+ clear_indicator_in_key_fields(key_info);
+ DBUG_VOID_RETURN;
+ }
+ }
else if (check_part_func_bound(part_info->part_field_array))
{
if (get_part_id_from_key(table,buf,key_info,key_spec,&part_part))
@@ -4163,12 +4199,13 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
!(thd->work_part_info= thd->lex->part_info->get_clone()))
DBUG_RETURN(TRUE);
+ /* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */
+ DBUG_ASSERT(!(alter_info->flags & ALTER_ADMIN_PARTITION));
+
if (alter_info->flags &
(ALTER_ADD_PARTITION | ALTER_DROP_PARTITION |
ALTER_COALESCE_PARTITION | ALTER_REORGANIZE_PARTITION |
- ALTER_TABLE_REORG | ALTER_OPTIMIZE_PARTITION |
- ALTER_CHECK_PARTITION | ALTER_ANALYZE_PARTITION |
- ALTER_REPAIR_PARTITION | ALTER_REBUILD_PARTITION))
+ ALTER_TABLE_REORG | ALTER_REBUILD_PARTITION))
{
partition_info *tab_part_info= table->part_info;
partition_info *alt_part_info= thd->work_part_info;
@@ -4219,8 +4256,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
alter_info->no_parts= curr_part_no - new_part_no;
}
}
- if (table->s->db_type()->alter_table_flags &&
- (!(flags= table->s->db_type()->alter_table_flags(alter_info->flags))))
+ if (!(flags= table->file->alter_table_flags(alter_info->flags)))
{
my_error(ER_PARTITION_FUNCTION_FAILURE, MYF(0));
DBUG_RETURN(1);
@@ -4560,11 +4596,7 @@ that are reorganised.
}
tab_part_info->no_parts-= no_parts_dropped;
}
- else if ((alter_info->flags & ALTER_OPTIMIZE_PARTITION) ||
- (alter_info->flags & ALTER_ANALYZE_PARTITION) ||
- (alter_info->flags & ALTER_CHECK_PARTITION) ||
- (alter_info->flags & ALTER_REPAIR_PARTITION) ||
- (alter_info->flags & ALTER_REBUILD_PARTITION))
+ else if (alter_info->flags & ALTER_REBUILD_PARTITION)
{
uint no_parts_found;
uint no_parts_opt= alter_info->partition_names.elements;
@@ -4572,18 +4604,7 @@ that are reorganised.
if (no_parts_found != no_parts_opt &&
(!(alter_info->flags & ALTER_ALL_PARTITION)))
{
- const char *ptr;
- if (alter_info->flags & ALTER_OPTIMIZE_PARTITION)
- ptr= "OPTIMIZE";
- else if (alter_info->flags & ALTER_ANALYZE_PARTITION)
- ptr= "ANALYZE";
- else if (alter_info->flags & ALTER_CHECK_PARTITION)
- ptr= "CHECK";
- else if (alter_info->flags & ALTER_REPAIR_PARTITION)
- ptr= "REPAIR";
- else
- ptr= "REBUILD";
- my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), ptr);
+ my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD");
DBUG_RETURN(TRUE);
}
if (!(*fast_alter_partition))
@@ -6836,9 +6857,11 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
field->set_null();
if (is_subpart)
{
- part_id= part_info->get_subpartition_id(part_info);
- init_single_partition_iterator(part_id, part_iter);
- return 1; /* Ok, iterator initialized */
+ if (!part_info->get_subpartition_id(part_info, &part_id))
+ {
+ init_single_partition_iterator(part_id, part_iter);
+ return 1; /* Ok, iterator initialized */
+ }
}
else
{
@@ -7007,13 +7030,18 @@ static uint32 get_next_partition_via_walking(PARTITION_ITERATOR *part_iter)
static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR *part_iter)
{
Field *field= part_iter->part_info->subpart_field_array[0];
+ uint32 res;
if (part_iter->field_vals.cur == part_iter->field_vals.end)
{
part_iter->field_vals.cur= part_iter->field_vals.start;
return NOT_A_PARTITION_ID;
}
field->store(part_iter->field_vals.cur++, FALSE);
- return part_iter->part_info->get_subpartition_id(part_iter->part_info);
+ if (part_iter->part_info->get_subpartition_id(part_iter->part_info,
+ &res))
+ return NOT_A_PARTITION_ID;
+ return res;
+
}
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 1b56683c0ed..436f889a56f 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1715,16 +1715,16 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
}
if (!plugin->plugin_dl)
{
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "Built-in plugins cannot be deleted,.");
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_PLUGIN_DELETE_BUILTIN, ER(WARN_PLUGIN_DELETE_BUILTIN));
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
goto err;
}
plugin->state= PLUGIN_IS_DELETED;
if (plugin->ref_count)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "Plugin is busy and will be uninstalled on shutdown");
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_PLUGIN_BUSY, ER(WARN_PLUGIN_BUSY));
else
reap_needed= true;
reap_plugins();
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index af33fdba71a..e5b00f79d6a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6886,6 +6886,7 @@ only_eq_ref_tables(JOIN *join,ORDER *order,table_map tables)
{
if (specialflag & SPECIAL_SAFE_MODE)
return 0; // skip this optimize /* purecov: inspected */
+ tables&= ~PSEUDO_TABLE_BITS;
for (JOIN_TAB **tab=join->map2table ; tables ; tab++, tables>>=1)
{
if (tables & 1 && !eq_ref_table(join, order, *tab))
@@ -8608,6 +8609,8 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
}
/* Flatten nested joins that can be flattened. */
+ TABLE_LIST *right_neighbor= NULL;
+ bool fix_name_res= FALSE;
li.rewind();
while ((table= li++))
{
@@ -8620,9 +8623,17 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
{
tbl->embedding= table->embedding;
tbl->join_list= table->join_list;
- }
+ }
li.replace(nested_join->join_list);
+ /* Need to update the name resolution table chain when flattening joins */
+ fix_name_res= TRUE;
+ table= *li.ref();
}
+ if (fix_name_res)
+ table->next_name_resolution_table= right_neighbor ?
+ right_neighbor->first_leaf_for_name_resolution() :
+ NULL;
+ right_neighbor= table;
}
DBUG_RETURN(conds);
}
@@ -9297,6 +9308,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
*/
if ((type= item->field_type()) == MYSQL_TYPE_DATETIME ||
type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE ||
+ type == MYSQL_TYPE_NEWDATE ||
type == MYSQL_TYPE_TIMESTAMP || type == MYSQL_TYPE_GEOMETRY)
new_field= item->tmp_table_field_from_field_type(table, 1);
/*
@@ -9813,11 +9825,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
}
if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields)
{ /* Can't calc group yet */
- ((Item_sum*) item)->result_field=0;
- for (i=0 ; i < ((Item_sum*) item)->arg_count ; i++)
+ Item_sum *sum_item= (Item_sum *) item;
+ sum_item->result_field=0;
+ for (i=0 ; i < sum_item->get_arg_count() ; i++)
{
- Item **argp= ((Item_sum*) item)->args + i;
- Item *arg= *argp;
+ Item *arg= sum_item->get_arg(i);
if (!arg->const_item())
{
Field *new_field=
@@ -9845,7 +9857,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
string_total_length+= new_field->pack_length();
}
thd->mem_root= mem_root_save;
- thd->change_item_tree(argp, new Item_field(new_field));
+ arg= sum_item->set_arg(i, thd, new Item_field(new_field));
thd->mem_root= &table->mem_root;
if (!(new_field->flags & NOT_NULL_FLAG))
{
@@ -9854,7 +9866,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
new_field->maybe_null() is still false, it will be
changed below. But we have to setup Item_field correctly
*/
- (*argp)->maybe_null=1;
+ arg->maybe_null=1;
}
new_field->field_index= fieldnr++;
}
@@ -14723,9 +14735,9 @@ count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param,
param->quick_group=0; // UDF SUM function
param->sum_func_count++;
- for (uint i=0 ; i < sum_item->arg_count ; i++)
+ for (uint i=0 ; i < sum_item->get_arg_count() ; i++)
{
- if (sum_item->args[0]->real_item()->type() == Item::FIELD_ITEM)
+ if (sum_item->get_arg(i)->real_item()->type() == Item::FIELD_ITEM)
param->field_count++;
else
param->func_count++;
@@ -14994,6 +15006,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
Item *pos;
List_iterator_fast<Item> li(all_fields);
Copy_field *copy= NULL;
+ IF_DBUG(Copy_field *copy_start);
res_selected_fields.empty();
res_all_fields.empty();
List_iterator_fast<Item> itr(res_all_fields);
@@ -15006,12 +15019,19 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
goto err2;
param->copy_funcs.empty();
+ IF_DBUG(copy_start= copy);
for (i= 0; (pos= li++); i++)
{
Field *field;
uchar *tmp;
Item *real_pos= pos->real_item();
- if (real_pos->type() == Item::FIELD_ITEM)
+ /*
+ Aggregate functions can be substituted for fields (by e.g. temp tables).
+ We need to filter those substituted fields out.
+ */
+ if (real_pos->type() == Item::FIELD_ITEM &&
+ !(real_pos != pos &&
+ ((Item_ref *)pos)->ref_type() == Item_ref::AGGREGATE_REF))
{
Item_field *item;
if (!(item= new Item_field(thd, ((Item_field*) real_pos))))
@@ -15058,6 +15078,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
goto err;
if (copy)
{
+ DBUG_ASSERT (param->field_count > (uint) (copy - copy_start));
copy->set(tmp, item->result_field);
item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1);
#ifdef HAVE_purify
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 3c3b728f980..c8922d9045e 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -515,7 +515,7 @@ public:
bool send_row_on_empty_set()
{
return (do_send_rows && tmp_table_param.sum_func_count != 0 &&
- !group_list);
+ !group_list && having_value != Item::COND_FALSE);
}
bool change_result(select_result *result);
bool is_top_level_join() const
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index b5ab6484d12..23e0514376b 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -619,7 +619,8 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
if ((table_list->view ?
view_store_create_info(thd, table_list, &buffer) :
- store_create_info(thd, table_list, &buffer, NULL)))
+ store_create_info(thd, table_list, &buffer, NULL,
+ FALSE /* show_database */)))
DBUG_RETURN(TRUE);
List<Item> field_list;
@@ -810,7 +811,8 @@ mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd)
DBUG_PRINT("enter",("table: %s",table_list->table->s->table_name.str));
protocol->prepare_for_resend();
- if (store_create_info(thd, table_list, packet, NULL))
+ if (store_create_info(thd, table_list, packet, NULL,
+ FALSE /* show_database */))
DBUG_RETURN(-1);
if (fd < 0)
@@ -1062,7 +1064,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
*/
int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
- HA_CREATE_INFO *create_info_arg)
+ HA_CREATE_INFO *create_info_arg, bool show_database)
{
List<Item> field_list;
char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], def_value_buf[MAX_FIELD_WIDTH];
@@ -1110,6 +1112,25 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
alias= share->table_name.str;
}
}
+
+ /*
+ Print the database before the table name if told to do that. The
+ database name is only printed in the event that it is different
+ from the current database. The main reason for doing this is to
+ avoid having to update gazillions of tests and result files, but
+ it also saves a few bytes of the binary log.
+ */
+ if (show_database)
+ {
+ const LEX_STRING *const db=
+ table_list->schema_table ? &INFORMATION_SCHEMA_NAME : &table->s->db;
+ if (strcmp(db->str, thd->db) != 0)
+ {
+ append_identifier(thd, packet, db->str, db->length);
+ packet->append(STRING_WITH_LEN("."));
+ }
+ }
+
append_identifier(thd, packet, alias, strlen(alias));
packet->append(STRING_WITH_LEN(" (\n"));
/*
@@ -1434,7 +1455,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
FALSE,
show_table_options))))
{
- packet->append(STRING_WITH_LEN(" /*!50100"));
+ packet->append(STRING_WITH_LEN("\n/*!50100"));
packet->append(part_syntax, part_syntax_len);
packet->append(STRING_WITH_LEN(" */"));
my_free(part_syntax, MYF(0));
@@ -2964,7 +2985,7 @@ static int fill_schema_table_names(THD *thd, TABLE *table,
@retval SKIP_OPEN_TABLE | OPEN_FRM_ONLY | OPEN_FULL_TABLE
*/
-static uint get_table_open_method(TABLE_LIST *tables,
+uint get_table_open_method(TABLE_LIST *tables,
ST_SCHEMA_TABLE *schema_table,
enum enum_schema_tables schema_table_idx)
{
@@ -2975,12 +2996,22 @@ static uint get_table_open_method(TABLE_LIST *tables,
{
Field **ptr, *field;
int table_open_method= 0, field_indx= 0;
+ uint star_table_open_method= OPEN_FULL_TABLE;
+ bool used_star= true; // true if '*' is used in select
for (ptr=tables->table->field; (field= *ptr) ; ptr++)
{
+ star_table_open_method=
+ min(star_table_open_method,
+ schema_table->fields_info[field_indx].open_method);
if (bitmap_is_set(tables->table->read_set, field->field_index))
+ {
+ used_star= false;
table_open_method|= schema_table->fields_info[field_indx].open_method;
+ }
field_indx++;
}
+ if (used_star)
+ return star_table_open_method;
return table_open_method;
}
/* I_S tables which use get_all_tables but can not be optimized */
@@ -4232,6 +4263,27 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
!my_strcasecmp(system_charset_info, tables->definer.host.str,
sctx->priv_host))
tables->allowed_show= TRUE;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ else
+ {
+ if ((thd->col_access & (SHOW_VIEW_ACL|SELECT_ACL)) ==
+ (SHOW_VIEW_ACL|SELECT_ACL))
+ tables->allowed_show= TRUE;
+ else
+ {
+ TABLE_LIST table_list;
+ uint view_access;
+ memset(&table_list, 0, sizeof(table_list));
+ table_list.db= tables->view_db.str;
+ table_list.table_name= tables->view_name.str;
+ table_list.grant.privilege= thd->col_access;
+ view_access= get_table_grant(thd, &table_list);
+ if ((view_access & (SHOW_VIEW_ACL|SELECT_ACL)) ==
+ (SHOW_VIEW_ACL|SELECT_ACL))
+ tables->allowed_show= TRUE;
+ }
+ }
+#endif
}
restore_record(table, s->default_values);
tmp_db_name= &tables->view_db;
@@ -6091,7 +6143,7 @@ ST_FIELD_INFO events_fields_info[]=
SKIP_OPEN_TABLE},
{"INTERVAL_FIELD", 18, MYSQL_TYPE_STRING, 0, 1, "Interval field",
SKIP_OPEN_TABLE},
- {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"STARTS", 0, MYSQL_TYPE_DATETIME, 0, 1, "Starts", SKIP_OPEN_TABLE},
{"ENDS", 0, MYSQL_TYPE_DATETIME, 0, 1, "Ends", SKIP_OPEN_TABLE},
{"STATUS", 18, MYSQL_TYPE_STRING, 0, 0, "Status", SKIP_OPEN_TABLE},
@@ -6334,8 +6386,8 @@ ST_FIELD_INFO triggers_fields_info[]=
{"ACTION_REFERENCE_OLD_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 1, "Created", OPEN_FULL_TABLE},
- {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, "sql_mode", OPEN_FULL_TABLE},
- {"DEFINER", 65535, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FULL_TABLE},
+ {"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, "sql_mode", OPEN_FULL_TABLE},
+ {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FULL_TABLE},
{"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
"character_set_client", OPEN_FULL_TABLE},
{"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
diff --git a/sql/sql_show.h b/sql/sql_show.h
index d63217584b2..3baaef00a7d 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -33,7 +33,7 @@ find_files_result find_files(THD *thd, List<LEX_STRING> *files, const char *db,
const char *path, const char *wild, bool dir);
int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
- HA_CREATE_INFO *create_info_arg);
+ HA_CREATE_INFO *create_info_arg, bool show_database);
int view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
int copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index e3447664922..6552a6bfab6 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1835,8 +1835,9 @@ bool quick_rm_table(handlerton *base,const char *db,
if (my_delete(path,MYF(0)))
error= 1; /* purecov: inspected */
path[path_length - reg_ext_length]= '\0'; // Remove reg_ext
- DBUG_RETURN(ha_delete_table(current_thd, base, path, db, table_name, 0) ||
- error);
+ if (!(flags & FRM_ONLY))
+ error|= ha_delete_table(current_thd, base, path, db, table_name, 0);
+ DBUG_RETURN(error);
}
/*
@@ -3547,11 +3548,13 @@ bool mysql_create_table_no_lock(THD *thd,
#endif /* HAVE_READLINK */
{
if (create_info->data_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "DATA DIRECTORY option ignored");
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "DATA DIRECTORY");
if (create_info->index_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "INDEX DIRECTORY option ignored");
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "INDEX DIRECTORY");
create_info->data_file_name= create_info->index_file_name= 0;
}
create_info->table_options=db_options;
@@ -4204,7 +4207,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
table->next_local= save_next_local;
thd->open_options&= ~extra_open_options;
#ifdef WITH_PARTITION_STORAGE_ENGINE
- if (table->table && table->table->part_info)
+ if (table->table)
{
/*
Set up which partitions that should be processed
@@ -4212,11 +4215,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
*/
Alter_info *alter_info= &lex->alter_info;
- if (alter_info->flags & ALTER_ANALYZE_PARTITION ||
- alter_info->flags & ALTER_CHECK_PARTITION ||
- alter_info->flags & ALTER_OPTIMIZE_PARTITION ||
- alter_info->flags & ALTER_REPAIR_PARTITION)
+ if (alter_info->flags & ALTER_ADMIN_PARTITION)
{
+ if (!table->table->part_info)
+ {
+ my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
uint no_parts_found;
uint no_parts_opt= alter_info->partition_names.elements;
no_parts_found= set_part_state(alter_info, table->table->part_info,
@@ -5018,8 +5023,9 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
}
VOID(pthread_mutex_unlock(&LOCK_open));
- IF_DBUG(int result=) store_create_info(thd, table, &query,
- create_info);
+ IF_DBUG(int result=)
+ store_create_info(thd, table, &query,
+ create_info, FALSE /* show_database */);
DBUG_ASSERT(result == 0); // store_create_info() always return 0
write_bin_log(thd, TRUE, query.ptr(), query.length());
@@ -5172,6 +5178,7 @@ err:
index_drop_count OUT The number of elements in the array.
index_add_buffer OUT An array of offsets into key_info_buffer.
index_add_count OUT The number of elements in the array.
+ candidate_key_count OUT The number of candidate keys in original table.
DESCRIPTION
'table' (first argument) contains information of the original
@@ -5202,7 +5209,8 @@ compare_tables(TABLE *table,
enum_alter_table_change_level *need_copy_table,
KEY **key_info_buffer,
uint **index_drop_buffer, uint *index_drop_count,
- uint **index_add_buffer, uint *index_add_count)
+ uint **index_add_buffer, uint *index_add_count,
+ uint *candidate_key_count)
{
Field **f_ptr, *field;
uint changes= 0, tmp;
@@ -5217,6 +5225,9 @@ compare_tables(TABLE *table,
create_info->varchar will be reset in mysql_prepare_create_table.
*/
bool varchar= create_info->varchar;
+ bool not_nullable= true;
+ DBUG_ENTER("compare_tables");
+
/*
Create a copy of alter_info.
To compare the new and old table definitions, we need to "prepare"
@@ -5234,24 +5245,21 @@ compare_tables(TABLE *table,
*/
Alter_info tmp_alter_info(*alter_info, thd->mem_root);
uint db_options= 0; /* not used */
-
- DBUG_ENTER("compare_tables");
-
/* Create the prepared information. */
if (mysql_prepare_create_table(thd, create_info,
- &tmp_alter_info,
- (table->s->tmp_table != NO_TMP_TABLE),
- &db_options,
- table->file, key_info_buffer,
- &key_count, 0))
+ &tmp_alter_info,
+ (table->s->tmp_table != NO_TMP_TABLE),
+ &db_options,
+ table->file, key_info_buffer,
+ &key_count, 0))
DBUG_RETURN(1);
/* Allocate result buffers. */
if (! (*index_drop_buffer=
- (uint*) thd->alloc(sizeof(uint) * table->s->keys)) ||
+ (uint*) thd->alloc(sizeof(uint) * table->s->keys)) ||
! (*index_add_buffer=
- (uint*) thd->alloc(sizeof(uint) * tmp_alter_info.key_list.elements)))
+ (uint*) thd->alloc(sizeof(uint) * tmp_alter_info.key_list.elements)))
DBUG_RETURN(1);
-
+
/*
Some very basic checks. If number of fields changes, or the
handler, we need to run full ALTER TABLE. In the future
@@ -5287,6 +5295,8 @@ compare_tables(TABLE *table,
create_info->used_fields & HA_CREATE_USED_ROW_FORMAT ||
create_info->used_fields & HA_CREATE_USED_PAGE_CHECKSUM ||
create_info->used_fields & HA_CREATE_USED_TRANSACTIONAL ||
+ create_info->used_fields & HA_CREATE_USED_PACK_KEYS ||
+ create_info->used_fields & HA_CREATE_USED_MAX_ROWS ||
(alter_info->flags & (ALTER_RECREATE | ALTER_FOREIGN_KEY)) ||
order_num ||
!table->s->mysql_version ||
@@ -5365,12 +5375,29 @@ compare_tables(TABLE *table,
*/
*index_drop_count= 0;
*index_add_count= 0;
+ *candidate_key_count= 0;
for (table_key= table->key_info; table_key < table_key_end; table_key++)
{
KEY_PART_INFO *table_part;
KEY_PART_INFO *table_part_end= table_key->key_part + table_key->key_parts;
KEY_PART_INFO *new_part;
+ /*
+ Check if key is a candidate key, i.e. a unique index with no index
+ fields nullable, then key is either already primary key or could
+ be promoted to primary key if the original primary key is dropped.
+ Count all candidate keys.
+ */
+ not_nullable= true;
+ for (table_part= table_key->key_part;
+ table_part < table_part_end;
+ table_part++)
+ {
+ not_nullable= not_nullable && (! table_part->field->maybe_null());
+ }
+ if ((table_key->flags & HA_NOSAME) && not_nullable)
+ (*candidate_key_count)++;
+
/* Search a new key with the same name. */
for (new_key= *key_info_buffer; new_key < new_key_end; new_key++)
{
@@ -6000,12 +6027,16 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint *index_drop_buffer;
uint index_add_count;
uint *index_add_buffer;
+ uint candidate_key_count;
+ bool committed= 0;
+ bool no_pk;
DBUG_ENTER("mysql_alter_table");
LINT_INIT(index_add_count);
LINT_INIT(index_drop_count);
LINT_INIT(index_add_buffer);
LINT_INIT(index_drop_buffer);
+ LINT_INIT(candidate_key_count);
/*
Check if we attempt to alter mysql.slow_log or
@@ -6416,7 +6447,8 @@ view_err:
&need_copy_table_res,
&key_info_buffer,
&index_drop_buffer, &index_drop_count,
- &index_add_buffer, &index_add_count))
+ &index_add_buffer, &index_add_count,
+ &candidate_key_count))
goto err;
if (need_copy_table == ALTER_TABLE_METADATA_ONLY)
@@ -6438,8 +6470,7 @@ view_err:
uint *idx_p;
uint *idx_end_p;
- if (table->s->db_type()->alter_table_flags)
- alter_flags= table->s->db_type()->alter_table_flags(alter_info->flags);
+ alter_flags= table->file->alter_table_flags(alter_info->flags);
DBUG_PRINT("info", ("alter_flags: %lu", alter_flags));
/* Check dropped indexes. */
for (idx_p= index_drop_buffer, idx_end_p= idx_p + index_drop_count;
@@ -6450,20 +6481,40 @@ view_err:
DBUG_PRINT("info", ("index dropped: '%s'", key->name));
if (key->flags & HA_NOSAME)
{
- /* Unique key. Check for "PRIMARY". */
- if (! my_strcasecmp(system_charset_info,
- key->name, primary_key_name))
+ /*
+ Unique key. Check for "PRIMARY".
+ or if dropping last unique key
+ */
+ if ((uint) (key - table->key_info) == table->s->primary_key)
{
+ DBUG_PRINT("info", ("Dropping primary key"));
/* Primary key. */
needed_online_flags|= HA_ONLINE_DROP_PK_INDEX;
needed_fast_flags|= HA_ONLINE_DROP_PK_INDEX_NO_WRITES;
pk_changed++;
+ candidate_key_count--;
}
else
{
+ KEY_PART_INFO *part_end= key->key_part + key->key_parts;
+ bool is_candidate_key= true;
+
/* Non-primary unique key. */
needed_online_flags|= HA_ONLINE_DROP_UNIQUE_INDEX;
needed_fast_flags|= HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES;
+
+ /*
+ Check if all fields in key are declared
+ NOT NULL and adjust candidate_key_count
+ */
+ for (KEY_PART_INFO *key_part= key->key_part;
+ key_part < part_end;
+ key_part++)
+ is_candidate_key=
+ (is_candidate_key &&
+ (! table->field[key_part->fieldnr-1]->maybe_null()));
+ if (is_candidate_key)
+ candidate_key_count--;
}
}
else
@@ -6473,7 +6524,8 @@ view_err:
needed_fast_flags|= HA_ONLINE_DROP_INDEX_NO_WRITES;
}
}
-
+ no_pk= ((table->s->primary_key == MAX_KEY) ||
+ (needed_online_flags & HA_ONLINE_DROP_PK_INDEX));
/* Check added indexes. */
for (idx_p= index_add_buffer, idx_end_p= idx_p + index_add_count;
idx_p < idx_end_p;
@@ -6483,14 +6535,38 @@ view_err:
DBUG_PRINT("info", ("index added: '%s'", key->name));
if (key->flags & HA_NOSAME)
{
- /* Unique key. Check for "PRIMARY". */
- if (! my_strcasecmp(system_charset_info,
- key->name, primary_key_name))
+ /* Unique key */
+
+ KEY_PART_INFO *part_end= key->key_part + key->key_parts;
+ bool is_candidate_key= true;
+
+ /*
+ Check if all fields in key are declared
+ NOT NULL
+ */
+ for (KEY_PART_INFO *key_part= key->key_part;
+ key_part < part_end;
+ key_part++)
+ is_candidate_key=
+ (is_candidate_key &&
+ (! table->field[key_part->fieldnr]->maybe_null()));
+
+ /*
+ Check for "PRIMARY"
+ or if adding first unique key
+ defined on non-nullable fields
+ */
+
+ if ((!my_strcasecmp(system_charset_info,
+ key->name, primary_key_name)) ||
+ (no_pk && candidate_key_count == 0 && is_candidate_key))
{
+ DBUG_PRINT("info", ("Adding primary key"));
/* Primary key. */
needed_online_flags|= HA_ONLINE_ADD_PK_INDEX;
needed_fast_flags|= HA_ONLINE_ADD_PK_INDEX_NO_WRITES;
pk_changed++;
+ no_pk= false;
}
else
{
@@ -6507,6 +6583,20 @@ view_err:
}
}
+ if ((candidate_key_count > 0) &&
+ (needed_online_flags & HA_ONLINE_DROP_PK_INDEX))
+ {
+ /*
+ Dropped primary key when there is some other unique
+ not null key that should be converted to primary key
+ */
+ needed_online_flags|= HA_ONLINE_ADD_PK_INDEX;
+ needed_fast_flags|= HA_ONLINE_ADD_PK_INDEX_NO_WRITES;
+ pk_changed= 2;
+ }
+
+ DBUG_PRINT("info", ("needed_online_flags: 0x%lx, needed_fast_flags: 0x%lx",
+ needed_online_flags, needed_fast_flags));
/*
Online or fast add/drop index is possible only if
the primary key is not added and dropped in the same statement.
@@ -6650,7 +6740,6 @@ view_err:
/* Copy the data if necessary. */
thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields
thd->cuted_fields=0L;
- thd_proc_info(thd, "copy to tmp table");
copied=deleted=0;
/*
We do not copy data for MERGE tables. Only the children have data.
@@ -6661,6 +6750,7 @@ view_err:
/* We don't want update TIMESTAMP fields during ALTER TABLE. */
new_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
new_table->next_number_field=new_table->found_next_number_field;
+ thd_proc_info(thd, "copy to tmp table");
error= copy_data_between_tables(table, new_table,
alter_info->create_list, ignore,
order_num, order, &copied, &deleted,
@@ -6672,6 +6762,7 @@ view_err:
VOID(pthread_mutex_lock(&LOCK_open));
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
VOID(pthread_mutex_unlock(&LOCK_open));
+ thd_proc_info(thd, "manage keys");
alter_table_manage_keys(table, table->file->indexes_are_disabled(),
alter_info->keys_onoff);
error= ha_autocommit_or_rollback(thd, 0);
@@ -7004,7 +7095,10 @@ err1:
close_temporary_table(thd, new_table, 1, 1);
}
else
- VOID(quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP));
+ VOID(quick_rm_table(new_db_type, new_db, tmp_name,
+ create_info->frm_only
+ ? FN_IS_TMP | FRM_ONLY
+ : FN_IS_TMP));
err:
/*
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index cee1c9d6bd4..050deeaf0ae 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -399,7 +399,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
else
{
- DBUG_ASSERT(!thd->stmt_arena->is_conventional());
/*
We're in execution of a prepared statement or stored procedure:
reset field items to point at fields from the created temporary table.
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index dbbc0e58d8a..7d7b08f964a 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1039,7 +1039,7 @@ reopen_tables:
correct order of statements. Otherwise, we use a TL_READ lock to
improve performance.
*/
- tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ;
+ tl->lock_type= read_lock_type_for_table(thd, table);
tl->updating= 0;
/* Update TABLE::lock_type accordingly. */
if (!tl->placeholder() && !using_lock_tables)
@@ -1076,11 +1076,14 @@ reopen_tables:
}
/* now lock and fill tables */
- if (lock_tables(thd, table_list, table_count, &need_reopen))
+ if (!thd->stmt_arena->is_stmt_prepare() &&
+ lock_tables(thd, table_list, table_count, &need_reopen))
{
if (!need_reopen)
DBUG_RETURN(TRUE);
+ DBUG_PRINT("info", ("lock_tables failed, reopening"));
+
/*
We have to reopen tables since some of them were altered or dropped
during lock_tables() or something was done with their triggers.
@@ -1096,6 +1099,34 @@ reopen_tables:
for (TABLE_LIST *tbl= table_list; tbl; tbl= tbl->next_global)
tbl->cleanup_items();
+ /*
+ To not to hog memory (as a result of the
+ unit->reinit_exec_mechanism() call below):
+ */
+ lex->unit.cleanup();
+
+ for (SELECT_LEX *sl= lex->all_selects_list;
+ sl;
+ sl= sl->next_select_in_list())
+ {
+ SELECT_LEX_UNIT *unit= sl->master_unit();
+ unit->reinit_exec_mechanism(); // reset unit->prepared flags
+ /*
+ Reset 'clean' flag back to force normal execution of
+ unit->cleanup() in Prepared_statement::cleanup_stmt()
+ (call to lex->unit.cleanup() above sets this flag to TRUE).
+ */
+ unit->unclean();
+ }
+
+ /*
+ Also we need to cleanup Natural_join_column::table_field items.
+ To not to traverse a join tree we will cleanup whole
+ thd->free_list (in PS execution mode that list may not contain
+ items from 'fields' list, so the cleanup above is necessary to.
+ */
+ cleanup_items(thd->free_list);
+
close_tables_for_reopen(thd, &table_list);
goto reopen_tables;
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 37fee49d37a..eb41e4c9b62 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -816,13 +816,24 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
DBUG_PRINT("info", ("View: %s", view_query.ptr()));
/* fill structure */
- view->select_stmt.str= view_query.c_ptr_safe();
- view->select_stmt.length= view_query.length();
view->source= thd->lex->create_view_select;
+ if (!thd->make_lex_string(&view->select_stmt, view_query.ptr(),
+ view_query.length(), false))
+ {
+ my_error(ER_OUT_OF_RESOURCES, MYF(0));
+ error= -1;
+ goto err;
+ }
+
view->file_version= 1;
view->calc_md5(md5);
- view->md5.str= md5;
+ if (!(view->md5.str= (char*) thd->memdup(md5, 32)))
+ {
+ my_error(ER_OUT_OF_RESOURCES, MYF(0));
+ error= -1;
+ goto err;
+ }
view->md5.length= 32;
can_be_merged= lex->can_be_merged();
if (lex->create_view_algorithm == VIEW_ALGORITHM_MERGE &&
@@ -949,8 +960,13 @@ loop_out:
lex_string_set(&view->view_connection_cl_name,
view->view_creation_ctx->get_connection_cl()->name);
- view->view_body_utf8.str= is_query.c_ptr_safe();
- view->view_body_utf8.length= is_query.length();
+ if (!thd->make_lex_string(&view->view_body_utf8, is_query.ptr(),
+ is_query.length(), false))
+ {
+ my_error(ER_OUT_OF_RESOURCES, MYF(0));
+ error= -1;
+ goto err;
+ }
/*
Check that table of main select do not used in subqueries.
@@ -1946,7 +1962,7 @@ mysql_rename_view(THD *thd,
goto err;
/* rename view and it's backups */
- if (rename_in_schema_file(view->db, view->table_name, new_name,
+ if (rename_in_schema_file(thd, view->db, view->table_name, new_name,
view_def.revision - 1, num_view_backups))
goto err;
@@ -1966,7 +1982,7 @@ mysql_rename_view(THD *thd,
num_view_backups))
{
/* restore renamed view in case of error */
- rename_in_schema_file(view->db, new_name, view->table_name,
+ rename_in_schema_file(thd, view->db, new_name, view->table_name,
view_def.revision - 1, num_view_backups);
goto err;
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 113248e980a..ba9a15d941b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1817,6 +1817,8 @@ event_tail:
if (!(lex->event_parse_data= Event_parse_data::new_instance(thd)))
MYSQL_YYABORT;
lex->event_parse_data->identifier= $3;
+ lex->event_parse_data->on_completion=
+ Event_parse_data::ON_COMPLETION_DROP;
lex->sql_command= SQLCOM_CREATE_EVENT;
/* We need that for disallowing subqueries */
@@ -4299,7 +4301,7 @@ create_select:
SELECT_SYM
{
LEX *lex=Lex;
- lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
+ lex->lock_option= TL_READ_DEFAULT;
if (lex->sql_command == SQLCOM_INSERT)
lex->sql_command= SQLCOM_INSERT_SELECT;
else if (lex->sql_command == SQLCOM_REPLACE)
@@ -5656,7 +5658,7 @@ alter_commands:
{
LEX *lex= Lex;
lex->sql_command = SQLCOM_OPTIMIZE;
- lex->alter_info.flags|= ALTER_OPTIMIZE_PARTITION;
+ lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
}
@@ -5666,7 +5668,7 @@ alter_commands:
{
LEX *lex= Lex;
lex->sql_command = SQLCOM_ANALYZE;
- lex->alter_info.flags|= ALTER_ANALYZE_PARTITION;
+ lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
}
@@ -5674,7 +5676,7 @@ alter_commands:
{
LEX *lex= Lex;
lex->sql_command = SQLCOM_CHECK;
- lex->alter_info.flags|= ALTER_CHECK_PARTITION;
+ lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->check_opt.init();
}
opt_mi_check_type
@@ -5683,7 +5685,7 @@ alter_commands:
{
LEX *lex= Lex;
lex->sql_command = SQLCOM_REPAIR;
- lex->alter_info.flags|= ALTER_REPAIR_PARTITION;
+ lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
}
@@ -8062,11 +8064,13 @@ variable:
variable_aux:
ident_or_text SET_VAR expr
{
- $$= new (YYTHD->mem_root) Item_func_set_user_var($1, $3);
+ Item_func_set_user_var *item;
+ $$= item= new (YYTHD->mem_root) Item_func_set_user_var($1, $3);
if ($$ == NULL)
MYSQL_YYABORT;
LEX *lex= Lex;
lex->uncacheable(UNCACHEABLE_RAND);
+ lex->set_var_list.push_back(item);
}
| ident_or_text
{
@@ -9394,7 +9398,7 @@ insert:
lex->duplicates= DUP_ERROR;
mysql_init_select(lex);
/* for subselects */
- lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
+ lex->lock_option= TL_READ_DEFAULT;
}
insert_lock_option
opt_ignore insert2
@@ -11297,8 +11301,7 @@ user:
if (check_string_char_length(&$$->user, ER(ER_USERNAME),
USERNAME_CHAR_LENGTH,
system_charset_info, 0) ||
- check_string_byte_length(&$$->host, ER(ER_HOSTNAME),
- HOSTNAME_LENGTH))
+ check_host_name(&$$->host))
MYSQL_YYABORT;
}
| CURRENT_USER optional_braces
diff --git a/sql/table.cc b/sql/table.cc
index 91a6c145610..b3c786010dd 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -3391,7 +3391,7 @@ TABLE_LIST *TABLE_LIST::find_underlying_table(TABLE *table_to_find)
}
/*
- cleunup items belonged to view fields translation table
+ cleanup items belonged to view fields translation table
SYNOPSIS
TABLE_LIST::cleanup_items()
@@ -3837,10 +3837,10 @@ Natural_join_column::Natural_join_column(Field_translator *field_param,
}
-Natural_join_column::Natural_join_column(Field *field_param,
+Natural_join_column::Natural_join_column(Item_field *field_param,
TABLE_LIST *tab)
{
- DBUG_ASSERT(tab->table == field_param->table);
+ DBUG_ASSERT(tab->table == field_param->field->table);
table_field= field_param;
view_field= NULL;
table_ref= tab;
@@ -3868,7 +3868,7 @@ Item *Natural_join_column::create_item(THD *thd)
return create_view_field(thd, table_ref, &view_field->item,
view_field->name);
}
- return new Item_field(thd, &thd->lex->current_select->context, table_field);
+ return table_field;
}
@@ -3879,7 +3879,7 @@ Field *Natural_join_column::field()
DBUG_ASSERT(table_field == NULL);
return NULL;
}
- return table_field;
+ return table_field->field;
}
@@ -4011,7 +4011,7 @@ void Field_iterator_natural_join::next()
cur_column_ref= column_ref_it++;
DBUG_ASSERT(!cur_column_ref || ! cur_column_ref->table_field ||
cur_column_ref->table_ref->table ==
- cur_column_ref->table_field->table);
+ cur_column_ref->table_field->field->table);
}
@@ -4175,7 +4175,7 @@ GRANT_INFO *Field_iterator_table_ref::grant()
*/
Natural_join_column *
-Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
+Field_iterator_table_ref::get_or_create_column_ref(THD *thd, TABLE_LIST *parent_table_ref)
{
Natural_join_column *nj_col;
bool is_created= TRUE;
@@ -4188,7 +4188,11 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
{
/* The field belongs to a stored table. */
Field *tmp_field= table_field_it.field();
- nj_col= new Natural_join_column(tmp_field, table_ref);
+ Item_field *tmp_item=
+ new Item_field(thd, &thd->lex->current_select->context, tmp_field);
+ if (!tmp_item)
+ return NULL;
+ nj_col= new Natural_join_column(tmp_item, table_ref);
field_count= table_ref->table->s->fields;
}
else if (field_it == &view_field_it)
@@ -4212,7 +4216,7 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
DBUG_ASSERT(nj_col);
}
DBUG_ASSERT(!nj_col->table_field ||
- nj_col->table_ref->table == nj_col->table_field->table);
+ nj_col->table_ref->table == nj_col->table_field->field->table);
/*
If the natural join column was just created add it to the list of
@@ -4277,7 +4281,7 @@ Field_iterator_table_ref::get_natural_column_ref()
nj_col= natural_join_it.column_ref();
DBUG_ASSERT(nj_col &&
(!nj_col->table_field ||
- nj_col->table_ref->table == nj_col->table_field->table));
+ nj_col->table_ref->table == nj_col->table_field->field->table));
return nj_col;
}
diff --git a/sql/table.h b/sql/table.h
index d21a9eefae8..ccd6b60664e 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -18,6 +18,7 @@
class Item; /* Needed by ORDER */
class Item_subselect;
+class Item_field;
class GRANT_TABLE;
class st_select_lex_unit;
class st_select_lex;
@@ -410,6 +411,7 @@ typedef struct st_table_share
int cached_row_logging_check;
#ifdef WITH_PARTITION_STORAGE_ENGINE
+ /** @todo: Move into *ha_data for partitioning */
bool auto_partitioned;
const char *partition_info;
uint partition_info_len;
@@ -419,6 +421,9 @@ typedef struct st_table_share
handlerton *default_part_db_type;
#endif
+ /** place to store storage engine specific data */
+ void *ha_data;
+
/*
Set share's table cache key and update its db and table name appropriately.
@@ -1012,7 +1017,7 @@ class Natural_join_column: public Sql_alloc
{
public:
Field_translator *view_field; /* Column reference of merge view. */
- Field *table_field; /* Column reference of table or temp view. */
+ Item_field *table_field; /* Column reference of table or temp view. */
TABLE_LIST *table_ref; /* Original base table/view reference. */
/*
True if a common join column of two NATURAL/USING join operands. Notice
@@ -1024,7 +1029,7 @@ public:
bool is_common;
public:
Natural_join_column(Field_translator *field_param, TABLE_LIST *tab);
- Natural_join_column(Field *field_param, TABLE_LIST *tab);
+ Natural_join_column(Item_field *field_param, TABLE_LIST *tab);
const char *name();
Item *create_item(THD *thd);
Field *field();
@@ -1603,7 +1608,7 @@ public:
GRANT_INFO *grant();
Item *create_item(THD *thd) { return field_it->create_item(thd); }
Field *field() { return field_it->field(); }
- Natural_join_column *get_or_create_column_ref(TABLE_LIST *parent_table_ref);
+ Natural_join_column *get_or_create_column_ref(THD *thd, TABLE_LIST *parent_table_ref);
Natural_join_column *get_natural_column_ref();
};
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 6c6a34e75ec..09401d20282 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -171,7 +171,7 @@ int archive_db_init(void *p)
if (pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST))
goto error;
- if (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
+ if (hash_init(&archive_open_tables, table_alias_charset, 32, 0, 0,
(hash_get_key) archive_get_key, 0, 0))
{
VOID(pthread_mutex_destroy(&archive_mutex));
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 85b8117e501..1a1a0d02375 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -18,6 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#define MYSQL_SERVER 1
#include "mysql_priv.h"
#include "ha_blackhole.h"
@@ -100,6 +101,24 @@ int ha_blackhole::write_row(uchar * buf)
DBUG_RETURN(table->next_number_field ? update_auto_increment() : 0);
}
+int ha_blackhole::update_row(const uchar *old_data, uchar *new_data)
+{
+ DBUG_ENTER("ha_blackhole::update_row");
+ THD *thd= ha_thd();
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query == NULL)
+ DBUG_RETURN(0);
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
+}
+
+int ha_blackhole::delete_row(const uchar *buf)
+{
+ DBUG_ENTER("ha_blackhole::delete_row");
+ THD *thd= ha_thd();
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query == NULL)
+ DBUG_RETURN(0);
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
+}
+
int ha_blackhole::rnd_init(bool scan)
{
DBUG_ENTER("ha_blackhole::rnd_init");
@@ -110,6 +129,9 @@ int ha_blackhole::rnd_init(bool scan)
int ha_blackhole::rnd_next(uchar *buf)
{
DBUG_ENTER("ha_blackhole::rnd_next");
+ THD *thd= ha_thd();
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query == NULL)
+ DBUG_RETURN(0);
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
@@ -189,6 +211,9 @@ int ha_blackhole::index_read_map(uchar * buf, const uchar * key,
enum ha_rkey_function find_flag)
{
DBUG_ENTER("ha_blackhole::index_read");
+ THD *thd= ha_thd();
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query == NULL)
+ DBUG_RETURN(0);
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
@@ -198,6 +223,9 @@ int ha_blackhole::index_read_idx_map(uchar * buf, uint idx, const uchar * key,
enum ha_rkey_function find_flag)
{
DBUG_ENTER("ha_blackhole::index_read_idx");
+ THD *thd= ha_thd();
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query == NULL)
+ DBUG_RETURN(0);
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
@@ -206,6 +234,9 @@ int ha_blackhole::index_read_last_map(uchar * buf, const uchar * key,
key_part_map keypart_map)
{
DBUG_ENTER("ha_blackhole::index_read_last");
+ THD *thd= ha_thd();
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query == NULL)
+ DBUG_RETURN(0);
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index d5a0d08926c..085840cce43 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -53,7 +53,7 @@ public:
ulonglong table_flags() const
{
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
- HA_BINLOG_STMT_CAPABLE |
+ HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE |
HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED);
}
@@ -72,7 +72,6 @@ public:
uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(uchar * buf);
int rnd_init(bool scan);
int rnd_next(uchar *buf);
int rnd_pos(uchar * buf, uchar *pos);
@@ -94,4 +93,8 @@ public:
THR_LOCK_DATA **store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
+private:
+ virtual int write_row(uchar *buf);
+ virtual int update_row(const uchar *old_data, uchar *new_data);
+ virtual int delete_row(const uchar *buf);
};
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index f670adb460c..5be8f5e67a0 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -112,6 +112,9 @@ server-id = 1
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
+#
+# binary logging format - mixed recommended
+#binlog_format=mixed
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index cc11ebfe63f..60b8138880e 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -191,6 +191,9 @@ tmp_table_size = 64M
# the ability to do point in time recovery from your latest backup.
log-bin=mysql-bin
+# binary logging format - mixed recommended
+binlog_format=mixed
+
# If you're using replication with chained slaves (A->B->C), you need to
# enable this option on server B. It enables logging of updates done by
# the slave thread into the slave's binary log.
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index 2e3143ac449..0d5719e4438 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -53,6 +53,9 @@ skip-federated
# binary logging is required for replication
log-bin=mysql-bin
+# binary logging format - mixed recommended
+binlog_format=mixed
+
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index 10d3e74f619..211b8ed5e8e 100644
--- a/support-files/my-medium.cnf.sh
+++ b/support-files/my-medium.cnf.sh
@@ -51,6 +51,9 @@ skip-federated
# binary logging is required for replication
log-bin=mysql-bin
+# binary logging format - mixed recommended
+binlog_format=mixed
+
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index cfaca64c293..11ad69f1f71 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -48,6 +48,9 @@ server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
+# binary logging format - mixed recommended
+#binlog_format=mixed
+
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
#innodb_data_file_path = ibdata1:10M:autoextend
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index f2b220cf53c..0a4afbb2698 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -32,11 +32,6 @@
%{?_with_cluster:%define CLUSTER_BUILD 1}
%{!?_with_cluster:%define CLUSTER_BUILD 0}
-# use "rpmbuild --with federated" or "rpm --define '_with_federated 1'" (for RPM 3.x)
-# to build with federated support (off by default)
-%{?_with_federated:%define FEDERATED_BUILD 1}
-%{!?_with_federated:%define FEDERATED_BUILD 0}
-
# use "rpmbuild --with maria" or "rpm --define '_with_maria 1'" (for RPM 3.x)
# to build with maria support (off by default)
%{?_with_maria:%define MARIA_BUILD 1}
@@ -336,8 +331,6 @@ mkdir -p $RBR%{_libdir}/mysql
PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin}
export PATH
-# Build the Debug binary.
-
# Use gcc for C and C++ code (to avoid a dependency on libstdc++ and
# including exceptions into the code
if [ -z "$CXX" -a -z "$CC" ]
@@ -346,16 +339,25 @@ then
export CXX="gcc"
fi
+# Prepare compiler flags
+CFLAGS=${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS}
+CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti }
+
##############################################################################
#
# Build the debug version
#
##############################################################################
-# Strip -Oxxx, add -g and --with-debug.
-(cd mysql-debug-%{mysql_version} &&
-CFLAGS=`echo "${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS} -g" | sed -e 's/-O[0-9]*//g'` \
-CXXFLAGS=`echo "${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti} -g" | sed -e 's/-O[0-9]*//g'` \
+(
+# We are in a subshell, so we can modify variables just for one run.
+CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]* //' -e 's/-unroll2 //' -e 's/-ip //' -e 's/$/ -g/'`
+CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-O[0-9]* //' -e 's/-unroll2 //' -e 's/-ip //' -e 's/$/ -g/'`
+
+# Add -g and --with-debug.
+cd mysql-debug-%{mysql_version} &&
+CFLAGS=\"$CFLAGS\" \
+CXXFLAGS=\"$CXXFLAGS\" \
BuildMySQL "--enable-shared \
--with-debug \
%if %{MARIA_BUILD}
@@ -380,8 +382,8 @@ fi
##############################################################################
(cd mysql-release-%{mysql_version} &&
-CFLAGS="${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS} -g" \
-CXXFLAGS="${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti} -g" \
+CFLAGS=\"$CFLAGS\" \
+CXXFLAGS=\"$CXXFLAGS\" \
BuildMySQL "--enable-shared \
--with-embedded-server \
%if %{MARIA_BUILD}
@@ -448,6 +450,9 @@ install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
# Install embedded server library in the build root
install -m 644 $MBD/libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
+# in RPMs, it is unlikely that anybody should use "sql-bench"
+rm -fr $RBR%{_datadir}/sql-bench
+
# Create a symlink "rcmysql", pointing to the init.script. SuSE users
# will appreciate that, as all services usually offer this.
ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
@@ -639,6 +644,7 @@ fi
%doc %attr(644, root, root) %{_infodir}/mysql.info*
+%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1*
%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
@@ -657,12 +663,14 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
%ghost %config(noreplace,missingok) %{_sysconfdir}/mysqlmanager.passwd
+%attr(755, root, root) %{_bindir}/innochecksum
%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisam_ftdump
%attr(755, root, root) %{_bindir}/myisamchk
@@ -703,6 +711,7 @@ fi
%attr(755, root, root) %{_bindir}/msql2mysql
%attr(755, root, root) %{_bindir}/mysql
%attr(755, root, root) %{_bindir}/mysql_find_rows
+%attr(755, root, root) %{_bindir}/mysql_upgrade_shell
%attr(755, root, root) %{_bindir}/mysql_waitpid
%attr(755, root, root) %{_bindir}/mysqlaccess
%attr(755, root, root) %{_bindir}/mysqladmin
@@ -715,6 +724,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
@@ -760,6 +770,8 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/ndb_config.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_desc.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_error_reporter.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_mgm.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_restore.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_backup_file.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_schema_file.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_sys_file.1*
@@ -771,13 +783,14 @@ fi
%files ndb-extra
%defattr(-,root,root,0755)
-%attr(755, root, root) %{_sbindir}/ndb_cpcd
%attr(755, root, root) %{_bindir}/ndb_delete_all
%attr(755, root, root) %{_bindir}/ndb_drop_index
%attr(755, root, root) %{_bindir}/ndb_drop_table
+%attr(755, root, root) %{_sbindir}/ndb_cpcd
%doc %attr(644, root, man) %{_mandir}/man1/ndb_delete_all.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_cpcd.1*
%endif
%files devel
@@ -788,6 +801,7 @@ fi
%dir %attr(755, root, root) %{_includedir}/mysql
%dir %attr(755, root, root) %{_libdir}/mysql
%{_includedir}/mysql/*
+%{_datadir}/aclocal/mysql.m4
%{_libdir}/mysql/libdbug.a
%{_libdir}/mysql/libheap.a
%if %{have_libgcc}
@@ -837,6 +851,29 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Thu Nov 06 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
+ This should cover both gcc and icc flags. Fixes bug#40546.
+
+* Fri Aug 29 2008 Kent Boortz <kent@mysql.com>
+
+- Removed the "Federated" storage engine option, and enabled in all
+
+* Tue Aug 26 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Get rid of the "warning: Installed (but unpackaged) file(s) found:"
+ Some generated files aren't needed in RPMs:
+ - the "sql-bench/" subdirectory
+ Some files were missing:
+ - /usr/share/aclocal/mysql.m4 ("devel" subpackage)
+ - Manual "mysqlbug" ("server" subpackage)
+ - Program "innochecksum" and its manual ("server" subpackage)
+ - Manual "mysql_find_rows" ("client" subpackage)
+ - Script "mysql_upgrade_shell" ("client" subpackage)
+ - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage)
+ - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage)
+
* Mon Mar 31 2008 Kent Boortz <kent@mysql.com>
- Made the "Federated" storage engine an option
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 6a21ae8107f..8fed29c48d6 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -7203,9 +7203,6 @@ static void test_field_misc()
{
MYSQL_STMT *stmt;
MYSQL_RES *result;
- MYSQL_BIND my_bind[1];
- char table_type[NAME_LEN];
- ulong type_length;
int rc;
myheader("test_field_misc");
@@ -7248,53 +7245,6 @@ static void test_field_misc()
mysql_free_result(result);
mysql_stmt_close(stmt);
- stmt= mysql_simple_prepare(mysql, "SELECT @@table_type");
- check_stmt(stmt);
-
- rc= mysql_stmt_execute(stmt);
- check_execute(stmt, rc);
-
- bzero((char*) my_bind, sizeof(my_bind));
- my_bind[0].buffer_type= MYSQL_TYPE_STRING;
- my_bind[0].buffer= table_type;
- my_bind[0].length= &type_length;
- my_bind[0].buffer_length= NAME_LEN;
-
- rc= mysql_stmt_bind_result(stmt, my_bind);
- check_execute(stmt, rc);
-
- rc= mysql_stmt_fetch(stmt);
- check_execute(stmt, rc);
- if (!opt_silent)
- fprintf(stdout, "\n default table type: %s(%ld)", table_type, type_length);
-
- rc= mysql_stmt_fetch(stmt);
- DIE_UNLESS(rc == MYSQL_NO_DATA);
-
- mysql_stmt_close(stmt);
-
- stmt= mysql_simple_prepare(mysql, "SELECT @@table_type");
- check_stmt(stmt);
-
- result= mysql_stmt_result_metadata(stmt);
- mytest(result);
- DIE_UNLESS(mysql_stmt_field_count(stmt) == mysql_num_fields(result));
-
- rc= mysql_stmt_execute(stmt);
- check_execute(stmt, rc);
-
- DIE_UNLESS(1 == my_process_stmt_result(stmt));
-
- verify_prepare_field(result, 0,
- "@@table_type", "", /* field and its org name */
- mysql_get_server_version(mysql) <= 50000 ?
- MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- "", "", /* table and its org name */
- "", type_length, 0); /* db name, length */
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-
stmt= mysql_simple_prepare(mysql, "SELECT @@max_error_count");
check_stmt(stmt);
@@ -7311,7 +7261,8 @@ static void test_field_misc()
"@@max_error_count", "", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
- "", 10, 0); /* db name, length */
+ /* db name, length */
+ "", MY_INT64_NUM_DECIMAL_DIGITS , 0);
mysql_free_result(result);
mysql_stmt_close(stmt);
@@ -7331,7 +7282,8 @@ static void test_field_misc()
"@@max_allowed_packet", "", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
- "", 10, 0); /* db name, length */
+ /* db name, length */
+ "", MY_INT64_NUM_DECIMAL_DIGITS, 0);
mysql_free_result(result);
mysql_stmt_close(stmt);
diff --git a/win/create_manifest.js b/win/create_manifest.js
index dec8f6e62e2..dbdd83588c5 100755
--- a/win/create_manifest.js
+++ b/win/create_manifest.js
@@ -31,7 +31,17 @@ try
var end= supp_version.indexOf("-");
if (end == -1) end= supp_version.length;
var app_version= supp_version.substring(0, end);
- app_version+= ".0";
+ var fourth_element= 0;
+ if(app_version.match(/[a-z]$/)) {
+ fourth_element+= (1 + app_version.charCodeAt(end-1) - "a".charCodeAt(0));
+ app_version= app_version.substring(0,--end);
+ }
+ if(app_version.match(/sp[1-9]$/)) {
+ fourth_element+= 100*(app_version.charCodeAt(end-1) - "0".charCodeAt(0));
+ app_version= app_version.substring(0, end-3);
+ end-= 3;
+ }
+ app_version+= "." + fourth_element;
break;
case "arch":
var app_arch= parts[1];
diff --git a/zlib/gzio.c b/zlib/gzio.c
index afac5352323..ed4e77ca7e9 100644
--- a/zlib/gzio.c
+++ b/zlib/gzio.c
@@ -7,10 +7,15 @@
/* @(#) $Id$ */
-#include "zutil.h"
+/* Need to be included "early" to control other headers */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
+#include "zutil.h"
+
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif